humanmade / tachyon

Faster than light image resizing service that runs on AWS. Super simple to set up, highly available and very performant.

Home Page:https://engineering.hmn.md/projects/tachyon/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for colour grading using LUTs

roborourke opened this issue · comments

It's not a super common use-case but when images from multiple sources are brought together they can make a design look somewhat "off".

It's possible for Tachyon to support colour grading using .cube files typically used with programs like Lightroom to apply transformations across multiple images to normalise the colourspace and luminance etc.

After a bit of research we could potentially use the following libraries:

The trickier part of this is how to get or specify the .cube file to be used. The most flexible way would be to fetch it from a URL specified in a query param and cache it strongly but initial image loads could be super slow with this method.

We'd also want to ensure that the .cube file was coming from the same domain as the original image request. Shouldn't be too hard but would need to check very carefully how that's handled when using nginx rewrites to pipe requests to a tachyon service within a network.

Also worth noting there's a number of free LUTs out there so we could perhaps bundle a few that can be referenced by name.

Been tinkering with some ICC profile based transforms at a low level in sharp as libvips doesn't really have any easy way to apply/use 3D LUTs right now and using the node packages described in the initial comment was super slow.

Feature request here: lovell/sharp#1441
Alternative implementation issue here: lovell/sharp#1323

Sample results:

original hilutite.icm (from lutify.me applied)

I don't think it's proper colour grading but I opened this PR that supports the above output on the sharp repo lovell/sharp#2271