Announcement

Collapse
No announcement yet.

First steps towards a new adjustment tool

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • klev
    replied
    Re: First steps towards a new adjustment tool

    Originally posted by Doug Nelson View Post
    Funny you should mention histograms. My first iteration of this idea I pitched directly to Adobe, as a histogram matching tool. But it was quickly demonstrated to me that this is a poor way to approach this. At the time I fought it, but I've since come to agree.

    Which is why I brought up the Premiere tool several posts up, as adding location to histogram seems like a plausible direction. But it only made things more confused.
    It was also done more than a decade ago. You pitched them something they were well aware of and had probably tested internally. In fact that's one of the papers I didn't link (because it sucks). The naive approach was to match both mean and median.

    Leave a comment:


  • joe_7
    replied
    Re: First steps towards a new adjustment tool

    If L/M/D means light/medium/dark:

    Code:
    1st image:
    |LLLLLLLLLLLLLLLL|MMMMMMMM|DDDDDDDD|
    
    2nd image:
    |LLLLLL|MMMMMMMMMMMMMM|DDDDDDDDDDDD|
    Pretend dragging the split marks in the second image to match the first.

    Is this the idea?

    Leave a comment:


  • Doug Nelson
    replied
    Re: First steps towards a new adjustment tool

    Funny you should mention histograms. My first iteration of this idea I pitched directly to Adobe, as a histogram matching tool. But it was quickly demonstrated to me that this is a poor way to approach this. At the time I fought it, but I've since come to agree.

    Which is why I brought up the Premiere tool several posts up, as adding location to histogram seems like a plausible direction. But it only made things more confused.

    Leave a comment:


  • joe_7
    replied
    Re: First steps towards a new adjustment tool

    Basically what I did:

    -find optimal 16 color palette in source image, sort by luminosity, stretch palette to 256 colors (could be more)
    -map colors to the destination image via RGB distance (r * r + g * g + b * b)

    So it's mapping color, but in an averaged out way. I'm not sure I fully understand the problem yet, but perhaps the goal is to make the destination image's histogram similar to that of the source image?

    Leave a comment:


  • Doug Nelson
    replied
    Re: First steps towards a new adjustment tool

    It's a step, but hue tools already exist. Can it remap luminosity, or just color?

    Leave a comment:


  • joe_7
    replied
    Re: First steps towards a new adjustment tool

    Did a quick & dirty test just to see if I understand the problem. I didn't use curves, and the results aren't perfect, but is this similar to the desired goal?

    (The results are posterized, but I think I can take care of that.)
    Attached Files

    Leave a comment:


  • klev
    replied
    Re: First steps towards a new adjustment tool

    Originally posted by Tulack View Post
    Black and white shoe is easy. What about colored shoe? Every part of it has not only value, but also hue and saturation. Also highlight of a black shoe would be white, how would you tell the mid point, from which nothing should be changed? White should stay white. Also output depends on input. If you target image slightly different from reference, it would look different even if you get numbers perfectly right.

    People asking "how to" because they don't know, not because they don't have tools.
    I sometimes wonder how you reach these conclusions. You are veering into technical areas rather than artistic ones, and it's a bad idea.

    Methods of automating a match relative to some metric have been attempted due to the labor cost of something which is ultimately tedious. Further hue, saturation, and value aren't completely decoupled in terms of human vision. A more modern way of looking at this would be one of examining cone response under a standardized model, as we can't completely control for visual processing. See LMS for one. I started to expand on that, but it's just too much material for a given post. The point was that yes there has been progress in automated variations on this. I linked one commercialized example in the previous post. That you can achieve the same thing today is irrelevant. I've altered colors by hand with various layers, masks, channel mixer, retinting bright reflections, etc. No one denied that was possible.

    Leave a comment:


  • klev
    replied
    Re: First steps towards a new adjustment tool

    Originally posted by pixaeiro View Post
    That would be awesome! Thanks!
    See Erik Reinhard's site for one. I own one of his books, and he's an excellent writer. Most of his papers are reachable from that link. Francoise Pitie did some interesting work, treating pixel level transitions as a probability density function.

    fast local color transfer via dominant colors mapping

    I can't find an unprivileged link for Xiao and Ma. It provides some of the earlier work in gradient preserving mappings. The ones above are more digestible anyway. It's also worth reviewing the wiki on the LMS color space, which is frequently used for reference in examining methods of decomposing an image into visually orthogonal channels. If you're interested in the segmentation aspects, google soft scissors or poisson image editing (poisson's equation in case you're interested).

    There are some books that might also help here, but anything really helpful won't be elementary reading.Others have attempted it in commercial products with my favorite being VSCO.

    If you're interested in more fundamental books about color, see Wyzecki and Stiles, Mark Fairchilds, Noboru Ohta, Jan Morovic. For basic implementations of open source color engines, see littleCMS or ArgyllCMS. I'm not digging up links on each book, but I would suggest you try an academic library. The books are otherwise quite expensive. Wyzecki and Stiles is really a hardcore science book used primarily for reference. The papers also sometimes refer to math texts when explaining the breakdown of their algorithms. They don't do this with anything elementary, including probability. Anything I link there is going to be fairly hardcore.

    Leave a comment:


  • Tulack
    replied
    Re: First steps towards a new adjustment tool

    Black and white shoe is easy. What about colored shoe? Every part of it has not only value, but also hue and saturation. Also highlight of a black shoe would be white, how would you tell the mid point, from which nothing should be changed? White should stay white. Also output depends on input. If you target image slightly different from reference, it would look different even if you get numbers perfectly right.

    People asking "how to" because they don't know, not because they don't have tools.
    Last edited by Tulack; 06-25-2015, 03:32 PM.

    Leave a comment:


  • pixaeiro
    replied
    Re: First steps towards a new adjustment tool

    Originally posted by klev
    I could probably link some of the papers.
    That would be awesome! Thanks!

    Leave a comment:


  • klev
    replied
    Re: First steps towards a new adjustment tool

    I'm not sure why you mentioned Premiere. The feature you described is more common in applications aimed at editing video. It just gives you the equivalent of a histogram for each segment of a given image. It tends to provide somewhat more context, especially in scenes with variable lighting, but it still requires some interpretation.

    Regarding geometric forms that aren't limited to 3 dimensions, hypersurfaces are a confusing topic, but they do come up in computer graphics. A lot of the stuff you mention is currently implemented in some way or an area of active research. For example computing differences between two things with respect to a given standard is currently done either via lookup table or linear transformation. ICC profiles actually use the latter. When you convert between them, the lookup is always with respect to a given profile connection space. If you wanted to remap one range of values to another based on measured values, you're back to an area of active research (and I can post many links). Also let me know if you want any crash course reading. I'm an obsessive reader.

    Leave a comment:


  • Doug Nelson
    replied
    Re: First steps towards a new adjustment tool

    By "perfect gradient" I meant some standard that only exists in theoretical ("perfect") space. Probably a poor choice of words, I'm a bit like Homer Simpson trying to understand living in a 3D world. It could very well end up being a cube or something only roughly imaginable in the real world. The important point is to have a fixed standard with which to compare the 2 photos against. It might very well exist in some higher bit-depth range.

    Premiere Pro has a scope which is sort of like a histogram only instead of just distribution it also shows location. So imagine a photo being raised up by the levels (and colors) involved depending on the amount of that particular value, then looking down on that. So the dark and light spots (in the case of Premiere, but we're talking some abstract model that also shows colors) not only show you how much of a tone exists but where it is located. I'm not saying this is the best way to do this, just as an example of a theoretical analysis space.

    The important point is we'd be comparing two images to a fixed standard, so we'd be able to extract all sorts of information about the differences from that standard, then we could compare those differences and extract the necessary math to convert from one to the other.

    Leave a comment:


  • klev
    replied
    Re: First steps towards a new adjustment tool

    Originally posted by pixaeiro View Post
    Hi Doug
    I spent some time investigating this problem, and the best I came up with ended up being a linear transformation (think curves with just 2 points).
    Linear transformations are used in photo filtering, some adjustment tools. Whenever you convert between color profiles, that is a linear transformation. There isn't a known ideal way to map one range into another. You could employ some strategy for smoothing / relaxation of data, but that doesn't qualify it as a perfect gradient. There's also the issue that once you step away from photoshop, gradient means something completely different. When he says a perfect gradient, I think he means a gradient of constant value. It wouldn't result in what expects, but I think it's what he meant. Suppose you remapped the image to a linear rgb basis with values encoded relative to some measure of intensity. It would need some inverse mapping to be usable, but you could do this as long as you can establish a clean workflow(see scene referred color workflows). At that point you could could rescale the range per channel to match the desired end points and mean or median. In fact that has been tested and abandoned by multiple researchers before moving on to different methods. I could probably link some of the papers.

    Leave a comment:


  • pixaeiro
    replied
    Re: First steps towards a new adjustment tool

    Hi Doug
    I spent some time investigating this problem, and the best I came up with ended up being a linear transformation (think curves with just 2 points), which could convert a black shoe into a white shoe, but I doubt is what you have in mind.
    Do you any other examples? Or maybe a graph that describes what you have in mind?

    Leave a comment:


  • klev
    replied
    Re: First steps towards a new adjustment tool

    Originally posted by Doug Nelson View Post
    For my mind experiment it is 0-255 gray linear RGB. But for the real application some other model might be more appropriate.
    Originally posted by Doug Nelson View Post
    Can MATLAB (or any other software) extract the values of an image and express them as a gradient? I'm thinking any image could be represented by 3 gradients, R, G, and B.

    Some sort of input/output mapping (I used curves in my example above, but this could be too complex for a curve) could remap each of these 3 gradients into a perfect 0-255 gradient. That would be the map for the source image (or source selection).

    Repeat said splitting and remapping on your destination image.

    Then <insert math> the transformation necessary to turn the destination map (or curve, or LUT, or whatever) into the source map could then be applied to the destination image (or selection) and it would then have the tonal values represented in the source image.

    An example:
    Source image: black shoe
    Destination image: white shoe
    Extract 3 gradients from source, remap to 0-255
    Extract 3 gradients from destination, remap to 0-255
    Calculate transformation to make destination map (curve, LUT, whatever) match source map
    Apply that transformation to actual destination image

    Result: white shoe is now a black shoe!

    It's possible this might need to use Lab or some other color space instead of RGB, otherwise the result might end up being like the source being pasted over the destination.
    There are several approaches to this. For digestible literature you could try Gonzalez and Woods. Erik Reinhard's books are quite readable, but they focus a lot on the statistical aspects. He also deals with color transfer, which is what you're thinking of here. If you're interested in color and chromatic adaptation models, look into the work and books by noboru ohta, mark fairchild, and jan morovic. Octave works well enough as a free matlab replacement. If you attempt any difficult books, supplement them with a set of course notes. Here's an example of adifficult book. The first one I mentioned is much easier to read, but it's also pretty dry. It's from more of an engineering perspective. This one is aimed at researchers. These are straight up math texts with extremely high applicability in graphics work. If you want to attempt some of it, be smart about it. Look at coursera or opencourseware for spare course notes to provide high level summaries and details that authors might omit. Make notes for yourself as you go. Just keep a spiral bound notebook next to you while you read. Work through all examples on paper. Try to re-derive things. Try to imagine applicability. Avoid the overly bloated texts or anything that just jumps between theorems with little exposition.

    Leave a comment:

Related Topics

Collapse

  • frankg
    Sampling & applying col from a photo to another
    by frankg
    If I have a photo with a skin col & density that I am very happy with and want to apply the same to another image, rather than going to Image>Adjustment>Match Color can I use the Col Sampler Tool & click on the face I like with the Info palette open & read the RGB &/or CMYK values....
    12-10-2012, 11:59 AM
  • mayday
    Gradient maps different uses and techniques?
    by mayday
    Gradient maps have many different uses and I think its probably one of the most versatile tools in photoshop.

    Heres a few of they ways I use them.

    You can use them to change and shift colour dramatically with precise control over the colours that you want to use.
    ...
    04-07-2008, 07:58 AM
  • atholg
    Gradient maps
    by atholg
    I have been restoring images for OPR for some time. My efforts at replacing damaged color leave something to be desired, particularly when the area is high contrast and there have to be subtle hue and saturation variations to achieve a natural result.

    A search located http://www.reto...
    07-18-2010, 06:27 PM
  • caroled
    curves + gradient
    by caroled
    I recieved this advise

    Since I am working with Elements 2 + hidden power toola would like to know if this is possible / and how to do it... My image is in forum Help request... Poley family 1906...

    Thanks

    Carol...
    01-22-2004, 11:11 AM
  • groovigyrl
    Gradient Map
    by groovigyrl
    Hi all,

    I'm experimenting with the gradient map and haven't been able to get too far with it. Argh. When I add the new adjustment layer for gradient map, my image switches to infrared (it looks like a film negative). It doesn't give me the box with the slide bar gradient that should automatically...
    10-14-2011, 07:57 PM
Working...
X