Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ColorMatch 3D (new colormatching tool)
#1
Just something I was working on:

https://github.com/TomArrow/ColorMatch3D/releases

[Image: 3j0PMJPF_t.png]

Give it an input and output image. Hit the red button, wait, then click the export button.

Benefits over DrDre's colormatch:
- Blazing fast. Depending on image size and your CPU, it can be less than a second
- Should be able to deal with more complex changes in theory due to a completely different algorithm

Downsides over DrDre:
- Doesn't generalize well. It will only match the colors in the image and no others, so applying the LUT to any other image will result in garbage. It might not even generalize well across an entire scene, so its use currently is to match single frames and maybe very similar frames.

Todo for the future:
- Try to integrate some interpolation option to make the 3D LUTS generalize better.
- Create an AVISynth plugin

The algorithm is childishly simple: Create an RGB cube in the size of the output LUT (32x32x32 atm). Take each color in the source image and create a vector to the color in the output image. Average all these vectors and place them in the RGB cube. Export RGB cube as LUT. Profit.

As you can see, the algorithm explains both the downsides and upsides. If I manage to do some interpolation (or maybe extrapolation is a better word), it would probably slow it down quite a bit, but maybe it could be made optional and controlled somehow, aka you could choose how much interpolation is to be done. We'll see.

Important note: Most of the options in the tool don't actually do anything, so don't bother with them. They are stuff I wanted to implement or might implement some day. The only option that really does anything currently is the "Aggregation Variable" being set to Absolute or Vector. Absolute is the old algorithm I had for months but it wasn't precise enough. Instead of averaging vectors, it was averaging absolute values, which gave decent results but in some situations the results were disappointing. The Vector algorithm is default now and solves that issue.

Edit: Since this is open source, feel free to contribute if you want to ofc.
Reply
#2
Nice work! This could be very useful for inserting replacement frames to fill gaps and so forth.
Reply
Thanks given by: TomArrow
#3
Did a little test involving a low-quality 70mm cell frames scan(?) of The Abyss and thought to post the results from Dr. Dre and TomArrow's Color Matchers with the same inputs at 250.

70mm & Cinemax Inputs
[Image: Abyss70-Comp-A.png] [Image: Abyss70-Comp-B.png]
Cinemax
[Image: vlcsnap-2020-11-15-02h06m44s230.png] [Image: vlcsnap-2020-11-15-02h07m04s394.png]
Regrade (Dr. Dre)
[Image: 70-Test-1-7-1.png] [Image: 70-Test-1-8-1.png]
Regrade (Tom Arrow)
[Image: Abyss70-Tom-Test-1-13-1.png] [Image: Abyss70-Tom-Test-1-14-1.png]
Although TomArrow's tool seems to get more appealing / accurate results in these two frames than Dr. Dre's, I notice banding in some areas (namely the helmets).
Don't have anything else to add really other than it's a nice starting point for something bigger @TomArrow, and I hope o see this tool built upon in the feature (whether it be by you or the community).
[Image: ivwz24G.jpg]
Reply
Thanks given by: TomArrow
#4
@LucasGodzilla Ah yes indeed. Those artifacts I encountered before. I think that to get rid of them, I might have to do the interpolation I was talking about. Currently the LUT has a lot of "black spaces" in it at the edges of the used colors, those artifacts are probably when the tool you are using tries to interpolate using those "not set" values that it just sees as black (which technically they are).

Thanks for doing a test!

Edit: About the banding ... might have to do with those artifacts too or might just be a limit of the source? Worst case could add some noise before application of the LUT.

Edit 2: Did you actually do the matching with those little images? That might be the reason it didn't work properly since the downscaling ditches some of the colors necessary to form the LUT. I wonder what results you would get if you do it at full resolution. Should be fast enough to do that.
Reply
Thanks given by: LucasGodzilla
#5
So, I might be an idiot, but I can't get the program to do anything at all. It calculates a histogram, but the images doesn't change at all. Am I doing something wrong?
There are the images I've used:
https://mega.nz/file/4NlTXAyC#V1eB2g_zR-...egi2y6Ak9o
https://mega.nz/file/RElD2CQD#_6JPPYtnPv..._sbZ2APeR0
Reply
Thanks given by: TomArrow
#6
(2020-11-20, 06:46 PM)Cactus Wrote: So, I might be an idiot, but I can't get the program to do anything at all. It calculates a histogram, but the images doesn't change at all. Am I doing something wrong?
There are the images I've used:
https://mega.nz/file/4NlTXAyC#V1eB2g_zR-...egi2y6Ak9o
https://mega.nz/file/RElD2CQD#_6JPPYtnPv..._sbZ2APeR0

Pardon for not being clearer. You need to export the 3D LUT and apply it in a suitable program. It doesn't show a preview.
Reply
Thanks given by:
#7
@Cactus

I tried your images. First off, the way you made them would likely not work because they weren't properly aligned.

Here's the aligned images:
[Image: hHE0ZM40_t.png] [Image: Y4DFacxp_t.png]

First, here's the result I get: Not very good. Looks weird as hell:

[Image: cXZSLmfr_t.png]

My explanation for why the match is this bad is that the second image has different areas graded differently, aka some areas are darker/brighter compared to the first image. Which means that there cannot be a perfect 3D LUT. In cases like this DrDre might give better results I think. However I did a little experiment and tried to equalize the brightness of the first image to match the second:

[Image: HD9w6ywv_t.png]

While the result is still far from good (I'm not sure something like this could even be done perfectly), it looks a lot more natural now, tho still not as good as you'd hope:

 [Image: hEweqwR8_t.png]

In short, this method isn't really very suited to matching grades that have had power windows used in them, as it will end up averaging things that don't belong together and such, since it takes everything very "literal".
Reply
Thanks given by: pipefan413 , Cactus
#8
Thank you, TomArrow. I've been working on an extended version of Danny the Dog/Unleashed but came to a standstill a while ago. Not only because of some vastly different grading, but with the American version also having some artificial camera movement added. I shall continue my quest. Smile
Reply
Thanks given by: TomArrow


Possibly Related Threads…
Thread Author Replies Views Last Post
  DrDre Colormatching Problems PDB 1 289 2020-05-10, 06:00 PM
Last Post: PDB
  Searching for a tool CaveDoctor 3 1,065 2019-01-16, 02:04 AM
Last Post: spoRv
  Tool to undo improper image stabilization? trondmm 6 2,709 2018-03-10, 10:02 AM
Last Post: TomArrow

Forum Jump:


Users browsing this thread: 1 Guest(s)