Yes, sounds reasonable. Let's set/accept an attribute called "jpeg:subsampling" 
set to one of those values for explicit control.

We want to detect and set it in the reader as well, so that "copy"-like 
operations from jpeg to jpeg preserve the sampling of the original unless 
overridden.

Now we just need to haggle over the proper default.

http://en.wikipedia.org/wiki/Chroma_subsampling
This states fairly clearly that 4:2:0 (what we do now) is the usual for 
JPEG/JFIF, MJPEG, DVD, BluRay, H.264, and many others. That's probably why the 
jpeg library uses this default. Maybe Nuke and ImageMagick go out of their way 
to request a somewhat higher quality? I'm tempted to argue for keeping the 
default as it is, and with the extra control, those who care could request 
4:2:2 or 4:4:4. But I'm willing to be swayed if consensus is that the default 
should be higher quality.



On Oct 16, 2014, at 2:59 PM, Justin Israel <[email protected]> wrote:

> So maybe the solution is to offer some constants like: 
> "4:4:4" - Calls jpeg_set_colorspace() with JCS_RGB
> "4:2:2" - does this, but uses SET_COMP(0, 1, 2,1, 0, 0,0); for the first 
> component instead
> "4:2:0" - Does exactly what it does now
> "4:1:1" - uses 4,1  1,1  1,1 for the 3 components
> Does that sound reasonable? Then you get as much control as Nuke/imagemagick 
> would offer 
> 

--
Larry Gritz
[email protected]



_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to