skip to Main Content

php-imagine: how can i make the watermark semi-transparent (reduce the opacity)?

I'm using https://github.com/php-imagine/Imagine (as use ImagineImagickImagine) to handle my images. I'm applying a transparent (alpha-channel) PNG image as watermark, following the docs here https://imagine.readthedocs.io/en/stable/usage/introduction.html#image-watermarking : $watermark = $imagine->open('/my/watermark.png'); $image = $imagine->open('/path/to/image.jpg'); $size = $image->getSize(); $wSize = $watermark->getSize(); $bottomRight = new…

VIEW QUESTION

How to get JPG file length in bytes AFTER resizing and compressing the image with Imagick in PHP?

I have the following code: $im = new Imagick($original_image_filename); $original_width = $im->getImageWidth(); $original_height = $im->getImageHeight(); $original_length = $im->getImageLength(); if($original_width > 300) { $im->scaleImage(300, 0); // max size for images is 300px wide } $scaled_width = $im->getImageWidth(); $scaled_height = $im->getImageHeight(); $scaled_length…

VIEW QUESTION

Converting TIFF to JPG via Imagick – Terrible Result – PHP

Source image: My Code: $mgck_wnd = new Imagick(); $mgck_wnd->readImageBlob($file); // 1 cmyk2rgb $img_colspc = $mgck_wnd->getImageColorspace(); if ($img_colspc != imagick::COLORSPACE_RGB && $img_colspc != imagick::COLORSPACE_GRAY) { $profiles = $mgck_wnd->getImageProfiles('*', false); // get profiles $has_icc_profile = (array_search('icc', $profiles) !== false); // we're interested…

VIEW QUESTION
Back To Top
Search