psimage does not do transparency
|Target version:||Candidate for next bugfix release|
|Affected version:||5.x-svn||Platform:||Mac OS X|
- When psimage plots a jpg or png that includes a transparent colour, the transparency does not show up in the result. Instead a solid colour is shown.
This can probably not be solved. I'm not sure that there is a good interface in the code right now to support a transparent colour straight from the image file.
This is Sun Raster heritage.
- When assigning a colour to be transparent using the option -Gt in psimage, the background colour is actually not replaced.
This is a discrepancy with what the manual says.
The manual also needs to be updated to talk less about Sun Raster files since gdal should be able to load most other image formats.
#2 Updated by Remko over 3 years ago
We should add some test scripts for this.
I just added test/psimage/transparency.sh to test this. Oddly enough -Gtblack works, but not any other. Also reading PNG files does not work properly.
If the transparent color is known then it should be possible to tell color image that, but perhaps the GMT_IMAGE struct need to retain more information from GDAL?
That is probably needed, indeed.
#7 Updated by Remko about 3 years ago
- % Done changed from 100 to 50
We need a fix for PNG (and probably other) 32-bit images. I suggest to only deal with RGBA images where A is either 0 or 255.
Otherwise we issue a warning and do no transparency.
Note that the -Gt option allows to set/overwrite the transparent colour. This should be honoured as well.