version: ImageMagick-6.7.5-7-Q16-windows-dll.exe
Small PNG 32bit images that only have greyscale colors with full 8bit alpha will not convert without loosing the alpha layer when using mogrify while convert still works.
"convert pngalpha.png -transparent none -resize 50% PNG32:pngalpha.png"
resulting in proper 32bit 50% scaled iamge
"mogrify pngalpha.png -transparent none -resize 50% PNG32:pngalpha.png"
resulting in proper 8 bit image index color
I spend hours trying everything to get mogrify to work but with no success.
PNG Transparency Bug (mogrify)
Re: PNG Transparency Bug (mogrify)
The first "pngalpha.png" in this command shouldn't be there. Removing it doesredkahuna wrote: "mogrify pngalpha.png -transparent none -resize 50% PNG32:pngalpha.png"
resulting in proper 8 bit image index color
not help, though. This works (using -format PNG32 instead of the PNG32: prefix):
Code: Select all
mogrify -transparent none -resize 50% -format PNG32 pngalpha.png
Re: PNG Transparency Bug (mogrify)
Thanks gleenrp,
It creates the correct image properties but now I need a way to truncate the name on output.
file result: pngalpha--large.PNG32
Is there a way to change the extension back to lowercase .png (not .PNG32) and truncate the name to pngalpha.png?
Also another bug exists where using this in a resize.bat dos script it will remove the resize % argument and turn it into a pixel width instead?
It creates the correct image properties but now I need a way to truncate the name on output.
Code: Select all
mogrify -transparent none -resize 50% -format PNG32 pngalpha--large.png
Is there a way to change the extension back to lowercase .png (not .PNG32) and truncate the name to pngalpha.png?
Also another bug exists where using this in a resize.bat dos script it will remove the resize % argument and turn it into a pixel width instead?
Re: PNG Transparency Bug (mogrify)
In recent versions (6.7.3-0 and later) you can use "-define png:format=png32" instead of "-format png32" and that does not change the extension.redkahuna wrote: Is there a way to change the extension back to lowercase .png (not .PNG32)
Re: PNG Transparency Bug (mogrify)
Thanks glennrp!
-
- Posts: 1
- Joined: 2012-08-01T12:51:11-07:00
- Authentication code: 15
Re: PNG Transparency Bug (mogrify)
So even though glennrp helpfully provided a workaround, this is still a glaring bug (using 6.7.8-5).
I can't imagine any circumstance where I would want mogrify to change the format of my image without me explicitly saying so, or unless an operation requires it (e.g. adding an alpha channel to a BMP24 could reasonably convert it to a BMP32). That is to say, this may be a more systemic issue than just the PNG32 case.
It's pretty weird to have to tell mogrify "Yeah, crop this png, oh and by the way, don't trash most of the information in the image, thanks."
Especially since it's already (apprently) working correctly with convert!
Thanks
I can't imagine any circumstance where I would want mogrify to change the format of my image without me explicitly saying so, or unless an operation requires it (e.g. adding an alpha channel to a BMP24 could reasonably convert it to a BMP32). That is to say, this may be a more systemic issue than just the PNG32 case.
It's pretty weird to have to tell mogrify "Yeah, crop this png, oh and by the way, don't trash most of the information in the image, thanks."
Especially since it's already (apprently) working correctly with convert!
Thanks