Opened 17 years ago
Closed 16 years ago
#2281 closed defect (duplicate)
QUANTIZE_FORCE does not support RGBA images
Reported by: | tbonfort | Owned by: | sdlime |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | MapServer C Library | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: |
Description
setting QUANTIZE_FORCE on an RGBA image causes artifacts. see attached images
Attachments (2)
Change History (6)
by , 17 years ago
comment:1 by , 17 years ago
from the libgd website
100% transparency of a single transparent color in the original truecolor image will be preserved. There is no other support for preservation of alpha channel or transparency in the destination image.
should probably close as wontfix, as fitting colors and alpha values in less than 256 paletted colors image rarely makes sense
follow-up: 3 comment:2 by , 17 years ago
Does transparency work with quantized output and RGB images? I suspect not. Does transparency work with RGB or RGBA images at all?
We don't write to the alpha channel with vector rendering at all with anything but 0 or 255 (0 to 127) anyway correct? So it seems like this should work except with GDAL images that actually might have alpha values other than fully opaque/transparent.
Steve
comment:3 by , 17 years ago
Replying to sdlime:
Does transparency work with quantized output and RGB images? I suspect not. Does transparency work with RGB or RGBA images at all?
it does work with rgb images, as in that case it's 'false'transparency, as the background of the image is opaque. transparency does work without quantization (see attachement spdc.2.png, the rivers are actually at opacity 70, although you do get nicer results with agg ;)
We don't write to the alpha channel with vector rendering at all with anything but 0 or 255 (0 to 127) anyway correct? So it seems like this should work except with GDAL images that actually might have alpha values other than fully opaque/transparent.
Actually that's not the case if you're antialiasing. all the border pixels of a shape will have their color set to the color of the shape, and their alpha set to something corresponding to their coverage of the pixel. that's why it not feasible to have nice paletted output:
consider a line going from (x,y) to (x+256,y+1). if you're antialiasing, you've got 128 different alpha values for this line alone. add to this other colors and alphas from other shapes....
thomas
imagemode rgba with quantize_force