![]() ![]() Then that image is composited onto the background and the lines and logo added on top to create the final image. First the function recolors all the applicable layer objects and then composites them and masks them to the "color" image (the "base" layer posted above in the shape of the wolf). This will make white the transparent colour. By default ImageMagick will 'optimize' the output, removing the alpha channel if it's all-opaque, and perhaps converting it to indexed format if fewer than 256 colors are present. You can do this in two steps: convert image.png -colorspace HSB -separate -negate imagemask.png convert image.png -alpha Off \ > imagemask.png -compose CopyOpacity -composite \ > PNG32:imagealpha.png. ![]() ![]() The composite process has been added below. Basically, what you want to do is create a mask, and then apply the mask to the image. In addition, everything that got recolored after the base layer (the first layer that gets recolored in this process) doesn't seem to be showing at all, with the only layers showing above being ones that are not recolored.Įdit: Here is one of the original input images that gets recolored: There is definitely color being applied, but it's not being applied in the shape of the supplied image. I'm not really sure what's causing this new behavior. $obj->setImageAlphaChannel(Imagick::ALPHACHANNEL_SHAPE) Įxample of image successfully recolored (pre-update):Įxample of the same input with current behavior (post-update): $obj->setImageAlphaChannel(Imagick::ALPHACHANNEL_EXTRACT) I use the following function to color an image using a given hex while preserving it's alpha shape and it's worked just fine up until updating. The update for both was done in cPanel's WHM. I have verified this in my site's phpinfo() and with the server command convert -version. I am now running ImageMagic 7.0.3 with the module 3.4.3. I recently upgraded the server's software from PHP 5.4 to PHP 7.0 and subsequently upgraded Imagick as well. I have an application that frequently uses Imagick's PHP module to recolor and composite images. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |