gdal icon indicating copy to clipboard operation
gdal copied to clipboard

Support YCbCr in JP2KAK

Open IdanAviv89 opened this issue 1 year ago • 1 comments

Feature description

Hi, Is there a way to add the ability to use gdal translate for a raster using the jp2kak driver, using the YCbCr color space ?

Additional context

No response

IdanAviv89 avatar Aug 22 '24 14:08 IdanAviv89

Is there a way to add the ability to use gdal translate for a raster using the jp2kak driver, using the YCbCr color space ?

no, enhancement queued for master branch in https://github.com/OSGeo/gdal/pull/10625

rouault avatar Aug 22 '24 20:08 rouault

Hi, Is there a way in gdalinfo to know if YUV/YCbCr was used ?

IdanAviv89 avatar Aug 30 '24 08:08 IdanAviv89

You can use the https://github.com/OSGeo/gdal/blob/master/swig/python/gdal-utils/osgeo_utils/samples/dump_jp2.py script.

$ gdal_translate autotest/gdrivers/data/small_world.tif small_world.jp2 -co YCC=YES -of JP2OpenJPEG $ python swig/python/gdal-utils/osgeo_utils/samples/dump_jp2.py small_world.jp2 | grep MCT <Field name="SGcod_MCT" type="uint8">1</Field> $ gdal_translate autotest/gdrivers/data/small_world.tif small_world.jp2 -co YCC=NO -of JP2OpenJPEG $ python swig/python/gdal-utils/osgeo_utils/samples/dump_jp2.py small_world.jp2 | grep MCT <Field name="SGcod_MCT" type="uint8">0</Field>

rouault avatar Aug 30 '24 14:08 rouault

Great! It might be good to consider adding this parameter into the gdalinfo. I think it will make it simpler and more accessible.

IdanAviv89 avatar Aug 30 '24 14:08 IdanAviv89