Dirty Transparency

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?".
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Dirty Transparency

Post by fmw42 »

Your file has an alpha channel (for transparency) you can verify that with


identify -verbose 0707cddlogo.png
Image: 0707cddlogo.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 800x415+0+0
Resolution: 72x72
Print size: 11.1111x5.76389
Units: Undefined
Type: TrueColorMatte
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 8-bit
Channel statistics:
Red:
min: 38 (0.14902)
max: 255 (1)
mean: 207.422 (0.81342)
standard deviation: 66.3569 (0.260223)
kurtosis: 1.05517
skewness: -1.49206
Green:
min: 129 (0.505882)
max: 255 (1)
mean: 228.515 (0.896135)
standard deviation: 35.5593 (0.139448)
kurtosis: 1.31335
skewness: -1.48454
Blue:
min: 217 (0.85098)
max: 255 (1)
mean: 248.482 (0.974439)
standard deviation: 11.8645 (0.0465276)
kurtosis: 0.567136
skewness: -1.49806
Alpha:
min: 191 (0.74902)
max: 255 (1)
mean: 254.648 (0.998619)
standard deviation: 4.08333 (0.0160131)
kurtosis: 173.238
skewness: 12.8993
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Dirty Transparency

Post by snibgo »

Gimp also shows that 0707cddlogo.png has an alpha channel.
snibgo's IM pages: im.snibgo.com
lorents
Posts: 42
Joined: 2010-07-06T04:27:53-07:00
Authentication code: 8675308

Re: Dirty Transparency

Post by lorents »

I am sorry, not that picture
http://img2.immage.de/0807960alleyesonapple.png

By optimisation PngOut reduces c PNG32 to PNG24
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: Dirty Transparency

Post by Drarakel »

Your last file has an alpha channel that's fully opaque. ImageMagick doesn't 'throw this away' automatically. You could do it manually by adding "-alpha off" (if you're sure that you don't need the alpha channel anymore). But it's better to leave these operations to the PNG optimizing tools.
lorents
Posts: 42
Joined: 2010-07-06T04:27:53-07:00
Authentication code: 8675308

Re: Dirty Transparency

Post by lorents »

I should find out before optimisation it PNG32 or PNG24
To apply

Code: Select all

convert dirty-tr-sample1.png -background Black -alpha Background dirtyclean1.png
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: Dirty Transparency

Post by Drarakel »

I'm not sure if I understood you.
You should try Fred's suggestion if you want to know whether your file has an alpha channel:
fmw42 wrote:convert image.png -format "%A" info:

Will return True or False


see http://www.imagemagick.org/script/escape.php
lorents
Posts: 42
Joined: 2010-07-06T04:27:53-07:00
Authentication code: 8675308

Re: Dirty Transparency

Post by lorents »

You have correctly understood me, here my picture
http://img2.immage.de/0807960alleyesonapple.png
ImageMagick asserts that a picture with an alpha a transparency, but actually it not so.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Dirty Transparency

Post by snibgo »

When I open that file in Gimp, I see an alpha channel.
snibgo's IM pages: im.snibgo.com
lorents
Posts: 42
Joined: 2010-07-06T04:27:53-07:00
Authentication code: 8675308

Re: Dirty Transparency

Post by lorents »

Has thought up, it is possible through optipng without parametres.
Now it is possible to carry out my idea.
All Thanks
lorents
Posts: 42
Joined: 2010-07-06T04:27:53-07:00
Authentication code: 8675308

Re: Dirty Transparency

Post by lorents »

Will admit I has applied such function

Code: Select all

convert dirty-tr-sample1.png -background Black -alpha Background dirtyclean1.png
It is possible but whether to turn the given action
Post Reply