summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-03-30Mark explicit dependency on requisites for BINLaslo Hunhold
2017-03-30Pass LDFLAGS instead of CFLAGS in the linking stageLaslo Hunhold
2017-03-30No need to keep the implicit build ruleLaslo Hunhold
2017-03-30Make Makefile strictly POSIX compliantLaslo Hunhold
Thanks Hiltjo for the feedback! GNUisms need to be avoided like a plague, even if it means having to be a little more creative. Strict POSIX compliance means that I just worked within the bounds of the POSIX specification, hopefully without using any GNU or BSD extensions. If I did, please let me know. Tip to all Linux users: Test your Makefiles with pmake(1) instead of make(1) (= GNU make) and refer to the newest POSIX 2016 make specification[0]. [0]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html
2017-03-29Rename PREREQ to REQLaslo Hunhold
2017-03-29Overhaul Build-systemLaslo Hunhold
I didn't like the current Makefiles. They were too crufted and not elegant. Additionally, given I'm planning to put some utility functions into a util.{c|h}-prerequisite, I wrote this new Makefile with PREREQs in mind.
2017-01-09Update TODOLaslo Hunhold
2017-01-09Add ff2pam(1): convert farbfeld to 16-bit RGBA Portable Arbitrary MapMattias Andrée
Laslo: Minor changes Signed-off-by: Mattias Andrée <maandree@kth.se>
2016-09-192ff: use trap to remove temporary fileFRIGN
This also frees us from having to store the return value somewhere.
2016-09-192ff: make it more portableFRIGN
Thanks Roberto and Evan Gates!
2016-09-192ff: Make it idempotent and clean it up a bitFRIGN
If a file begins with "farbfeld", we just pass it through.
2016-09-07Shellcheck 2ff fixesFRIGN
I was inspired by the current discussion on dev@ to use shellcheck to check my scripts and thought it might be a good choice to do this for the 2ff script. Not much had to be changed, because I was careful writing it, but still it won't hurt to but $TMP in double quotes.
2016-05-19Improve fread error handling in ff2*Alexander Krotov
In case of unexpected end of file errno is not set, and strerror(errno) returns "Success". Caller should distinguish between error and EOF by calling ferror(3) as described in fread(3).
2016-05-18Makefile improvementsHiltjo Posthuma
- fix: rebuild on source change. - allow to override dependency flag per tool (the ones that have deps). - rebuild on config.mk or headers change.
2016-05-18Revert "Fix Makefile to rebuild when there have been changes"FRIGN
This reverts commit 545c500d4278c50e781c9a5a550e92cb0023c8e8.
2016-05-17Fix Makefile to rebuild when there have been changesFRIGN
I forgot to add the dependencies in the build process
2016-04-10Remove dimension checksFRIGN
This may come as a surprise, but I'd like the libraries to handle these cases. Maybe some day libpng supports 0x0 images, so why impose artificial limits here? Same with ppm. For me, an ideal data converter loses as little information as possible. In mixed cases (dimensions 0xn, where n > 0) we could print a warning, but here, 2 principles come at play: - GIGO (garbage in, garbage out) - no information loss if possible Given the code later on won't try to access the malloc(0) region, we are also all safe.
2016-04-03Remove line-breaks from MakefileFRIGN
Even though I like line-length limits, it imposed a useless limitation on the console output, given the line input is variable.
2016-04-03Makefile improvementsHiltjo Posthuma
- be verbose by default: don't hide the executed commands. - no need to make clean on make dist, but make sure to have a clean directory. - define 2ff in ${SCRIPTS}. - make dist: gzip directly, don't store intermediate step (faster for make dist on floppies). - don't cd into directories, just loop each file.
2016-04-03add ff2jpg tool, convert farbfeld images to RGB JPEGHiltjo Posthuma
2016-04-03don't link against unneeded libsHiltjo Posthuma
- jpg2ff requires libjpeg - ff2png, png2ff requires libpng (and libz) - ff2ppm has no dependencies
2016-04-03fix bugs introduced by refactor f0a4ce113d0e9dc50110a0ad9e98433d05aa2307Hiltjo Posthuma
2016-03-21Use uint8_t instead of uint16_t correctlyFRIGN
2016-03-21Write a better format for the row-buffer allocationFRIGN
2016-03-21Optimize ff2ppm(1)FRIGN
use the proper multiplication factors :)
2016-03-21add arg.h (needed for ff2ppm)Hiltjo Posthuma
2016-03-21add ff2ppm(1)Hiltjo Posthuma
ff2ppm can convert farbfeld images to PPM (P6 binary format, 24-bit RGB). ff2ppm has an option -b to set the background color, for example for png files: png2ff < test.png | ff2ppm -b '#00ff00' > test.ppm
2016-03-18Prevent overflow in rowlen and improve inaccuracies in styleFRIGN
2016-03-14Bump version to 2FRIGN
There have been quite considerable changes since version 1. The conversion tools have had a considerable performance boost of around 75% by using a row-buffer instead of reading each R-G-B-A-chunk individually. Also, 2ff(1) somehow called "xconvert" instead of "convert", rendering it useless for anything other than png's and jpg's. There was a small excursion to color spaces and ICC color profile handling, but this has been dismissed (it was a difficult decision). Thanks for all the feedback!
2016-03-04Add proper blank lines in png2ff(1) before commentsFRIGN
2016-03-04Fix 2 little things in jpg2ff(1)FRIGN
- actually print usage when one argument is given (forgot to incorporate the argv0-change there). - use fputs instead of fprintf for printing a string constant.
2016-03-04Use uint32-array to store the headerFRIGN
this goes around the undefined behaviour imposed by using (*(uint32_t *)(hdr + 4n))
2016-03-04Fix 2ffFRIGN
No idea how "xconvert" sneaked into there.
2016-02-22Remove last ICC tracesFRIGN
2016-02-22Use the "row-major" term instead of "row-aligned"FRIGN
2016-02-01Refactor tools and increase performance by ~70%FRIGN
Instead of calling fwrite on each channel, we write one big chunk of a line. This increases performance by around 70% compared to version 1 and the farbfeld tools are now roughly fast as imagemagick's convert. I also refactored the code, removed unnecessary variables and unified the variable naming and error reporting a bit. Inside jpg2ff, the loop didn't need 3 variables.
2016-01-31Move alpha-premultiplication information away from the FORMATFRIGN
and rather define it in the manual. In the end, it doesn't influence the data structure and thus is not part of the FORMAT-specification.
2016-01-29Back to the roots.FRIGN
Talking with even more people and weighing the benefits, I've made the decision to remove color spaces from farbfeld again (as it currently is handled in version 1) and recommend sRGB, not force it. Thing is the following: We are not ready yet for this step. Neither the people working with the images nor the hardware to display extended colors. Using greater colorspaces also removes the "hackability" of farbfeld. As it was previously possible to easily create gradients in plain C, you have to keep multiple things in mind with linear ProPhoto RGB. The first thing is that not all colors are "real", and there are imaginary colors. This doesn't happen with sRGB because all the colors it describes are "real". The second thing is the linear gamma curve, which makes the gradients look perceptually inconsistent. In the interest of creating a good and simple interchange format, we can't only weigh in points of professionals. This little excursion has shown that aiming for the 99% is still the way to go. And as often as you could repeat that sRGB will meet its fate in the future when screens become better, it is surprising how badly the industry has caught up to it. I also must honestly say that we can't solve the color space issue using RGB and should look at other formats to explore (CIELUV, CIELAB), which I will probably give a talk about at slcon3. Before releasing version 2, my aim is to make the I/O a bit more effective (as far as possible) so it's even easier to use. I know people will be pissed off, but fuck it, I'm the maintainer! Live with it.
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-19Update manpage reflecting the features of each toolFRIGN
2016-01-19Remove more png cruft from codeFRIGN
No need for these shitty png-types.
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-17Fix gcc-optimization bug in png2ffFRIGN
For some reason, those strange png_char_pp-passes were optimized away in some way, yielding in icc_len = 0. I now explicitly use the pointers to indicate to the compiler that we pass by reference. Fuck those png types...
2016-01-17Clarify manpages in regard to the ICC handlingFRIGN
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-15Add short note on alpha-premultiplicationFRIGN
2016-01-06Add 'dist' to .PHONYFRIGN
Thanks Dimitris for reporting this!
2016-01-06Bump version to 1FRIGN
And add a makerule to create a tarball via make dist.
2016-01-06Install manpages in $PREFIX/man not $PREFIX/share/manFRIGN
Real men use /man and don't /share/man
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.