lfod1997 / LUTools

Simple commandline tool & header-only library to create, batch-apply and convert 3D LUTs
BSD 2-Clause "Simplified" License
14 stars 0 forks source link

Creating a LUT file based on an image #1

Closed carlosedubarreto closed 1 year ago

carlosedubarreto commented 1 year ago

First, thanks a lot for this tool. It seems very good.

But I have some doubts on how to use it. If you allow me to ask, how can I create a custom lutmap? I read the instruction many times, but could not undertand very well what I should do.

lfod1997 commented 1 year ago

Hi, to create a lutmap is fairly simple:

  1. Get the "mother map" of all lutmaps. It's already included in the Release zip archive, named "lutmap4096.png"; it's also available in the source code repository, under the img directory.
  2. Open lutmap4096.png in any software that's able to process an image, e.g. Photoshop, Snapseed, Facetune, even Twitter...
  3. Apply the filter you wish to rip, to lutmap4096.png. e.g. you have a fancy filter in your software that gives a nice vintage tone, you want to get it lutmapp-ed, then you just apply that filter to lutmap4096.png. Especially, in Photoshop (and its like), you can apply as many adjustment layers as you like on top of lutmap4096.png -- all these are considered as a single complicated filter.
  4. Save the processed image you get from step 3 as an image file, preferably, in PNG format if you can (some software only supports saving in JPEG).
  5. Open that image file on your PC and check that its resolution is 4096 x 4096. If it isn't, resize the image This is necessary because when you save an image in some unprofessional software, it will limit the maximum resolution to, say, 2K-by-2K. But a lutmap must be 4096 x 4096. In this case, you'll need to resize the image file, which can be done in any professional image processor, e.g. Photoshop, GIMP (which is open source)... In case you don't know how to check the resolution of an image file on a Windows PC, right click the file and choose "Properties", switch to the "Details" tab, then scroll down to the "Image" section, look at the "Dimensions" value -- that's the resolution we want.
  6. All done. The 4K-by-4K-sized colorful little PNG is your lutmap. It contains everything about an image recoloring filter, ready to be used with LUTools.

If you're still having problems, feel free to ask me =)

Also note that while LUTs being powerful, they have their limitations: they are all about recoloring, that is, manipulating only the colors in an image. So filters like Gaussian Blur, adding noise, adding scratches, lens flares... these are impossible to reconstruct with a mere LUT.

carlosedubarreto commented 1 year ago

Thanks a lot for the answer. I was haing a better thought and looks like what I wanted is not possible with this repository. I understoo that I should apply a filter to the lutmap, and using that altered lutmap I'll be able to make the color changes on a new image.

But what I really wanted and was searching is a way to create a lut from a single image. It like having a photograf of a sunset and get those colors to apply on another picture, like color matcher does.(https://github.com/hahnec/color-matcher)

You may ask, if I know that color matcher already does it, why I'm trying with LUTools? I'm trying because I wanted to save that "pallete" to apply on other images, maybe create a library of palletes.

Thanks a lot for the detailed explanation.