How to resize image in magento?

To resize image in magento use below code and pass image url as parameter in Varien_Image object.

/** Varien Image object for image url */
    $imageObj = new Varien_Image($imageUrl);
/** Set constrain */
    $imageObj->constrainOnly(true);
/** Keep Image Aspect ratio */
    $imageObj->keepAspectRatio(false);
/** Keep Image frame */
    $imageObj->keepFrame(false);
/** Keep Image Transparency */
    $imageObj->keepTransparency(true);
/** Set image background Color */
    $imageObj->setImageBackgroundColor(false);
/** Set background color */
    $imageObj->backgroundColor(false);
/** Set image quality */
    $imageObj->quality(100);
/** Set watermark Image Opacity */
    $imageObj->setWatermarkImageOpacity(0);
/** Set image size and */
    $imageObj->resize(182, 126);
/** Save image at given new file path */
    $imageObj->save($imageResized);