Page 1 of 1

Transparency usage story

Posted: 2012-02-28T23:47:09-07:00
by Janek
Hi,

After long inactivity on ImageMagick I've upgraded binaries to ImageMagick-6.7.54, and I saw that some commands works different. Problem was with transparencies.
I've solved problem and now I can show you story of changes in transparency usage.
If you just want to put coloured text on transparent background, and save image to png you need:

before ImageMagick-6.5.23-Q8:

Code: Select all

convert -background transparent -pointsize 55 label:"test" outputPNG32.png
ImageMagick-6.5.23-Q8

Code: Select all

convert -background transparent -pointsize 55 label:"test" -define png:color-type=6 outputPNG32.png
ImageMagick-6.7.54-Q8

Code: Select all

convert -background transparent -virtual-pixel background -pointsize 55 label:"test" -define png:color-type=6 outputPNG32.png
Have you simpler and more version independent way for this task?

Re: Transparency usage story

Posted: 2012-02-29T00:04:20-07:00
by anthony
Janek wrote:Hi,

After long inactivity on ImageMagick I've upgraded binaries to ImageMagick-6.7.54, and I saw that some commands works different. Problem was with transparencies.
I've solved problem and now I can show you story of changes in transparency usage.
If you just want to put coloured text on transparent background, and save image to png you need:

before ImageMagick-6.5.23-Q8: convert -background transparent -pointsize 55 label:"test" outputPNG32.png
ImageMagick-6.5.23-Q8 convert -background transparent -pointsize 55 label:"test" -define png:color-type=6 outputPNG32.png
ImageMagick-6.7.54-Q8 convert -background transparent -virtual-pixel background -pointsize 55 label:"test" -define png:color-type=6 outputPNG32.png

Have you simpler and more version independent way for this task?
I don't understand your need for the virtual-pixel setting (highlighted above).

Virtual pixels are used in operations such as blurs, convolve, morphology, distortions, and some FX user functions, where images are being referenced outside their normal 'real' boundaries.
See http://www.imagemagick.org/Usage/misc/#virtual-pixel

Re: Transparency usage story

Posted: 2012-02-29T00:24:39-07:00
by Janek
I don't know meaning of virtual-pixel operator. I'm don't understand too why this work, but example from ImageMagick-6.5.23-Q8 doesn't work in ImageMagick-6.7.54-Q8.
I'm just guessing how bring transparency and saw that virtual-pixel helps.

See that

Code: Select all

convert -background transparent -pointsize 55 label:"test" -define png:color-type=6 outputPNG32.png
doesn't produce transparent background in ImageMagick-6.7.54-Q8 and newer.

maybe this is bug

Here is comment for 6.7.5-4

Code: Select all

2012-02-08  6.7.5-4 Cristy  <quetzlzacatenango@image...>
  * Set image alpha channel for -virtual-pixel background and transparent.
  * Get tiff:fill-order as an image artifact, not an image option.

p.s. thank you for fast reply

Re: Transparency usage story

Posted: 2012-02-29T08:22:43-07:00
by glennrp
Janek wrote: Have you simpler and more version independent way for this task?
Instead of

Code: Select all

... -define png:color-type=6 outputPNG32.png
you can just write

Code: Select all

... PNG32:outputPNG32.png

Re: Transparency usage story

Posted: 2012-02-29T18:49:21-07:00
by anthony
Janek wrote:See that

Code: Select all

convert -background transparent -pointsize 55 label:"test" -define png:color-type=6 outputPNG32.png
doesn't produce transparent background in ImageMagick-6.7.54-Q8 and newer.

maybe this is bug
Yes I would say this is a bug...

I can confirm that the lable comes out all black

Code: Select all

convert -background none -pointsize 55 label:"test" -verbose info:

Code: Select all

  ...
    Format: LABEL (Image label)
  Class: DirectClass
  Geometry: 90x63+0+0
  Resolution: 72x72
  Print size: 1.25x0.875
  Units: Undefined
  Type: Bilevel
  Base type: Bilevel
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 16/1-bit
  Channel depth:
    gray: 1-bit
    alpha: 1-bit
  Channel statistics:
    Gray:
      min: 0 (0)
      max: 0 (0)
      mean: 0 (0)
      standard deviation: 0 (0)
      kurtosis: 0
      skewness: 0
    Alpha:
      min: 65535 (1)
      max: 65535 (1)
      mean: 65535 (1)
      standard deviation: 0 (0)
      kurtosis: 0
      skewness: 0
  Colors: 1
  ...
Alpha is present, image it should be black with variable alpha but it is totally opaque!

Definatally something is wrong. -- reporting

Re: Transparency usage story

Posted: 2012-02-29T20:03:54-07:00
by glennrp
I used IM 7.0.0-0 2012-01-02 Q16 and it looks fine. However, using IM 6.7.5-8 Q16 (svn r 7001) it's just a black image When I use .txt format instead of .png it still behaves the same, just a black opaque image. The bug seems to be in the "label:" format, not in the PNG format.

Re: Transparency usage story

Posted: 2012-03-05T01:24:54-07:00
by Janek
Hi,

I've seen that in new ImageMagick-6.7.5-9 works fine. In changelog is mentioned that bug is fixed in ImageMagick-6.7.5-8.

thank you for fixing

Re: Transparency usage story

Posted: 2012-03-06T00:47:18-07:00
by anthony
Yes confirmed. It is now working again. IM v6.7.5-9