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)

spdc.png (20.7 KB ) - added by tbonfort 17 years ago.
imagemode rgba with quantize_force
spdc.2.png (83.1 KB ) - added by tbonfort 17 years ago.
imagemode rgba without quantize_force

Download all attachments as: .zip

Change History (6)

by tbonfort, 17 years ago

Attachment: spdc.png added

imagemode rgba with quantize_force

by tbonfort, 17 years ago

Attachment: spdc.2.png added

imagemode rgba without quantize_force

comment:1 by tbonfort, 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

comment:2 by sdlime, 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

in reply to:  2 comment:3 by tbonfort, 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

comment:4 by tbonfort, 16 years ago

Resolution: duplicate
Status: newclosed

superceded by #2436

Note: See TracTickets for help on using tickets.