"Bastian Rolf" on wrote...
| "Anthony Thyssen" on wrote...
| | And why not... it is transparent and transparent is not visible.
| | Anything that is fully transparent should not matter what color it is.
| | This pre-multiplication is standard, but only should only make
| | fully-transparent pixels fully-transparent black. It should not
| | effect the result for semi-transparent or fully opaque pixels.
|
| Depends on what you plan to do with the resulting image. If you treat
| the result as a simple 2d-image (and maybe that's what Magick is
| supposed to do), and you want to render it by mapping pixels one on one,
| this is makes no problems. If you plan to use the result as a texture
| for 3D-graphics, this is different.
|
| Typically, a texel of these images won't be mapped onto one screen
| pixel. During rendering, the graphics pipeline interpolates each channel
| of the image separately.
|
That is ONLY valid for RGB channels. A channel is not the same and does
not get handled the same in all situations.
| So, if the colors of fully transparent pixels are replaced by black,
| the color channels are interpolated ...hmm.. let's say in an
| unexpected way ;) They all fade to black.
|
In which case you should not be using the alpha channel at all!
Again the alpha channel by default is a transparency indicator, and that
is all, it effects the results of the other channels.
Very few programs go though the mathematical hoops and twists needed to
ensure that fully transparent colors (which should not have any
interpoleded results anyway) remain non-black.
IM has been working very hard to remove the fully transparent color
effects from operations as not doing so results in weird 'halos' and
other effects that should not exist.
| To give an example: If you use an magick-scaled image as texture for the
| leaves of a tree, and the "observer" gets very near to this tree, every
| leave gets a thin, dark border.
|
That is the point, if the pixel is fully transparent, or even near fully
transparent then no (or little) effects should be seen on the result.
If this is NOT the case then your texturing algorithm is failing to do
its job correctly! IE IM did the right thing, but the renderer for the
tree leaves did the wrong thing!
Fully transparent colors should have no interpolated effect.
| Furthermore, I also would like to rescale 32 bit images, where the
| information in the 4th channel actually are no transparency information.
|
In that case seperate the channels then process the image. In such
situations 4 channels often later become 5, 6 or even more channels.
I am proposing a change to -seperate to allow multi-channel seperation.
EG: convert input_image -channel RGBA -separate \
..process.. \
-combine output_image
Should let you process the image as 4 grey scale images, rather than
a single RGBA image.
This has NOT been implented yet, and requires an expandsion of the
-separate operation beyond a single channel.
This has been added to the future devopment page.
http://www.cit.gu.edu.au/~anthony/graphics/imagick6/bugs/future/
| Currently, the only way to do this is to decompose each image, scale
| each channel separately, and to recombine them at the end, or to use
| your suggestion to modify the 4th channel before and after scaling (what
| won't work for images that use the 4th channel for something else than
| transparency).
|
With the proposed -separate addition, that will be easy!
convert input_image -channel RGBA -separate \
-resize 300% \
-combine output_image
Basically it just turns off transparency handling as a transparency.
In the mean time the following will do the same thing, but as two
images...
convert input_image \
\( +clone -channel A -separate +channel -negate \) \
+matte -resize 300% \
-compose CopyOpacity -composite output_image
This seems to work perfectally in my tests.
The above was added to the IM examples at the bottom of the 'channels'
examples page, but needs a full write up rather than the urrent notes.
Anthony Thyssen ( System Programmer ) <[EMAIL PROTECTED]>
-----------------------------------------------------------------------------
"A house is no home unless it contain food and fire for the
mind as well as for the body." -- Margaret Fuller
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users