• 0

How do I keep PNG transparency with ImageMagick?


Question

I've been googling like mad trying everything now. I can't find a solution to my problem.

This is the image I'm converting:

panel.png

It's quite transparent, and when I rescale the image I want it to keep the exact same transparency.

Using this command: convert panel.png -liquid-rescale $width_in_percent%\!x100%\! PNG32:$screen_width-panel.png

I've tried putting these inside it (in all possible combinations):

-alpha on

-background transparent

-colorspace RGB

-channel RGBA

The image just loses all the transparency. I'm clueless... :(

I'm also wondering if liquid-rescale can ignore some pixels for the rounded left and right edges on the image. If not, is there another way to not make those stretch?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

None of that worked. However, I managed to find something that did work a little bit...

convert panel.png -liquid-rescale $width_in_percent%\!x100%\! -channel A -fx A/2 -channel RGBA $screen_width-panel.png

Unfortunately that just makes the image about 50% transparent, it doesn't keep the original transparency.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.