PNG semi-transparency problem

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
vtv

PNG semi-transparency problem

Post by vtv »

Hi.
Could someone help me with using IM to colorize png file and save semi-transparency?
I was using mvg to create complex images that include text images thumbnails and other things. Now I need to add label that can be different shape with transparency and semi-transparency. PNG files are just great for this - designer have to give me png file and I can create different manipulations with it. Now I got a problem - I need to give a possibility to change label color on my complex image. I understand that with mvg this is probably impossible, so I'm going to use regular command line commands and -draw option.
The problem is that when applying something like

Code: Select all

-fill blue -colorize 50%
it will also change transparency and semi-transparency of the label png file to some color. I need to keep transparency though.
Is there way to do that?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PNG semi-transparency problem

Post by fmw42 »

Can you post an example?

your probably need to specify -channel rgb before your command and possibly re-enable the alpha afterwards using -alpha. An example would help pin it down.
vtv

Re: PNG semi-transparency problem

Post by vtv »

solution found.

This how it works fine.

Code: Select all

convert -respect-parenthesis -size 540x190 xc:rgb(255,255,255) ( -page +0+0 1.png -fill green -tint 100% ) -flatten result.jpg
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: PNG semi-transparency problem

Post by anthony »

Nothing about that solution involved MVG. MVG is purely the syntax for the -draw command.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply