LWN.net Logo

Image scaling problem

Image scaling problem

Posted Mar 4, 2010 23:04 UTC (Thu) by spitzak (guest, #4593)
In reply to: SCALE 8x: Color management for everyone by rgmoore
Parent article: SCALE 8x: Color management for everyone

This has little, if anything, to do with "color management".

If as the original poster said, everybody could assume the image is sRGB, then the scaling algorithim could be designed to correctly scale sRGB. This is much easier than something that can scale "anything".

Also from everything I have learned about color management, there appears to be a need for a "blending space" that is controllable and that scaling and mixing is always done linearly in this blending space. If this blending space is sRGB then the scaling is in fact required to do the "wrong" result. You need to change the "blending space" to some linear color space for blending to be correct.


(Log in to post comments)

Image scaling problem

Posted Mar 5, 2010 2:02 UTC (Fri) by rgmoore (✭ supporter ✭, #75) [Link]

If as the original poster said, everybody could assume the image is sRGB, then the scaling algorithim could be designed to correctly scale sRGB. This is much easier than something that can scale "anything".
A) I'm not sure that it would be any easier to do everything on the raw sRGB data. It's not just image scaling but all aspects of image processing that are easier to do on linear data. It's likely to be easier to write one algorithm to convert sRGB to linear and one to convert it back than to include an implicit implicit conversion in every image processing algorithm. And if you care about correctness- which you obviously do if you're bothering to worry about the gamma applied data- it's going to be much easier to prove that you're doing everything correctly by working on explicitly gamma corrected data than to count on having the correction in every routine.

B) The "everything is sRGB" assumption is untrue. Real world programs have to deal with all kinds of color spaces. Once you have to deal with more than two color spaces (sRGB and linear), the need for real color management will be much more obvious.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds