[gdal-dev] What happens by default when writing RGBA into jpeg?

Even Rouault even.rouault at mines-paris.org
Tue Jun 10 04:46:46 PDT 2014


Selon Jukka Rahkonen <jukka.rahkonen at mmmtike.fi>:

> Hi,
>
> I would like to know what happens if I convert an original RGBA tiff image
> into jpeg as
>
> gdal_translate -of jpeg rgba_in.tif jpeg_out.jpg
>
> I know that for getting a good result I can add "-b 1 -b 2 -b 3" but I am
> curious to know what happens and how GDAL computes sort of a transparent
> sepia coloured mask when run without selecting bands.

It will result in a TIFF with separate bands (PLANARCONFIG_SEPARATE :
http://www.awaresystems.be/imaging/tiff/tifftags/planarconfiguration.html), each
of them JPEG compressed. So for a transparency mask with "instantenous" changes
between zones of fully transparence and fully opacity, you'll have JPEG
artifacts.
I'm wondering if the "sepia coloured mask" is not caused by a viewer that will
be confused by this TIFF configuration and would assume a CMYK color space
instead of RGB.

>
> -Jukka Rahkonen-
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>




More information about the gdal-dev mailing list