summaryrefslogtreecommitdiff
path: root/jpg2ff.c
AgeCommit message (Collapse)Author
2016-01-20Use linear RGBFRIGN
Makes things a lot easier for image manipulation algorithms which can be expected to be applied to farbfeld data.
2016-01-17Add ICC-color-profile handling to jpg2ffFRIGN
And fix a bug in the transforms that was introduced yesterday. The only thing remaining for jpg is handling EXIF-embedded color profiles, but the EXIF format sucks so bad.
2016-01-17Mandate "ProPhoto RGB" color space for farbfeld and handle ICC profilesFRIGN
I've literally been thinking about this for quite a while now. The initial motivation behind defaulting to sRGB was the idea that most data on the web was in sRGB anyway. However, my assumption was weakened in the sense that the development is clearly moving towards images with supplied ICC profiles and software slowly catching up to handle this. My tests have shown that more and more people even do that on the web, even though it's been a "tradition" that Photoshop users "Save for Web" and convert the gamut lossy into sRGB to bring a consistent color-"experience" even to those clients not supporting ICC profiles and which always assume sRGB. What made this decision so difficult is that converting to "ProPhoto RGB" requires some advanced knowledge on this topic, however, I came to the conclusion to implement it given the *2ff- and ff2*-tools handle it silently and well in the background, and given the little cms library is actually quite okay to use. When converting from ff to png, a proper "Pro Photo RGB" ICC V4-profile is automatically included in the exported png by ff2png. V4 is not as widespread as V2, but in the worst case (no V4 support somewhere) the colors will just be a little off. As an added bonus, any input files for png2ff which include ICC profiles are also correctly handled and the color space conversions are executed as expected. Accordingly, the FORMAT-specification has been changed. While at it, I added the note on alpha-multiplication. Now the format is very exact and shouldn't leave any ambiguities. jpeg supports ICC profiles as well, but I hadn't had the chance to look into it (not as trivial as PNG probably, help appreciated :)), so I'm always assuming sRGB here. Rationale --------- It is not obvious why one would go through the lenghts of supporting this big-gamut colorspace and not just stick with sRGB. In 99% of the cases, there's no reason to do that, but with even more extreme developments in the OLED-sector and other advances display hardware is slowly getting more powerful than sRGB, asking for color information which is suitable for the task and actually uses the full potential. The decision in this regard was not difficult in farbfeld because we always use 16-Bit anyway and won't have to fear posterization in a big- gamut color-space.
2016-01-06Improve error-handling in the toolsFRIGN
We don't need the jumps, but rather pass a nice function pointer to libpng. The jump in libjpg was also useless. We check each fwrite-call so there's an early bailout in case the output file is full. Flushing at the end worked as well, but it took too long for complex images. We don't want to "block" a pipe here and the approach in jpg2ff was better. The iHDR-read was useless. Rather use the get*-functions in libpng, saves us 2 local variables as well.
2016-01-06Forgot to add argv[0] to fprintfFRIGN
2016-01-06Refactor jpg2ffFRIGN
Remove some kitchen sink comments (the jpg boilerplate is already horrible enough) and flush the output buffer manually to detect write errors. Also improve error reporting.
2015-12-08fix segfault on JPG errorFRIGN
thanks Quentin Rameau!
2015-11-23JPG Code cleanupFRIGN
2015-11-23(Re)add jpg2ffFRIGN
Thanks z3bra for porting this! Also change 2ff to use case instead of if-blocks.