GNOME Bugzilla – Bug 767850
jpeg2000parse: parsed mono jpc image gets color space set to RGB
Last modified: 2016-08-16 20:25:31 UTC
Single channel image should get sampling and color space set to GRAYSCALE/GRAY.
The following pipeline gst-launch-1.0 -v multifilesrc location=~/a1_mono.j2c num-buffers=1 caps="image/x-jpc" ! jpeg2000parse ! openjpegdec ! imagefreeze ! videoconvert ! ximagesink fails negotiation
Created attachment 330740 [details] [review] Force sampling and colorspace to grayscale for single component image
I think this should be a fairly uncontroversial change :)
Note: test file is a monochrome j2c file
So, now that the dust has settled on the latest release, can we please merge this fix into master ? It is quite straightforward: for monochrome images, we can force sampling and colorspace to grayscale. Thanks :)
Comment on attachment 330740 [details] [review] Force sampling and colorspace to grayscale for single component image Does this make sense? I could imagine a use case where someone passes around separate images for e.g. R, G and B. Maybe only do this if there's no useful info in the caps?
(In reply to Sebastian Dröge (slomo) from comment #6) > Comment on attachment 330740 [details] [review] [review] > Force sampling and colorspace to grayscale for single component image > > Does this make sense? I could imagine a use case where someone passes around > separate images for e.g. R, G and B. > > Maybe only do this if there's no useful info in the caps? Thanks, that is a good point. This is really edge case, I guess, but I will add a few lines to handle this.
(In reply to Sebastian Dröge (slomo) from comment #6) > Comment on attachment 330740 [details] [review] [review] > Force sampling and colorspace to grayscale for single component image > > Does this make sense? I could imagine a use case where someone passes around > separate images for e.g. R, G and B. > > Maybe only do this if there's no useful info in the caps? I believe the parser already does this if caps have no useful info. So, I am going to close this, not really a bug IMHO. User can always explicitly set sampling to GRAYSCALE.