RetouchPRO

Go Back   RetouchPRO > Tools > Software
Register Blogs FAQ Site Nav Search Today's Posts Mark Forums Read


Software Photoshop, Lightroom, Paintshop Pro, Painter, etc., and all their various plugins. Of course, you can also discuss all other programs, as well.

First steps towards a new adjustment tool

Reply
 
Thread Tools
  #1  
Old 05-03-2015, 09:39 PM
Doug Nelson's Avatar
Doug Nelson Doug Nelson is offline
Janitor
 
Join Date: Aug 2001
Posts: 7,068
Blog Entries: 21
First steps towards a new adjustment tool

I decided to split this off from this thread so as to not derail it.

I'm not an engineer, so pardon my fuzziness.

I've got this idea in my head that if we assume a perfect gradient, then compare the tonal range of part of an image to that gradient, the differences could be portrayed as a curve.

Then, if we did the same to a similar tonal range section of another image we'd have another curve. Then some math (I warned you, I'm not an engineer) could be done to determine what would be required to transform the second curve into the first curve. Then that math could be applied to the actual second image section and we'd have a way to adjust images based on other images.

So then we'd have a quick, precise solution to the frequent questions such as "how do I turn a white shoe into a black shoe", not to mention skin tone.

Lightning bolt or dead horse?
Reply With Quote top
  #2  
Old 05-03-2015, 09:58 PM
pixaeiro pixaeiro is offline
Member
 
Join Date: Feb 2015
Posts: 32
Re: First steps towards a new adjustment tool

Hi Doug,

Do you have some images to explain your idea in a more graphical way? Even if they are just sketches on photos it could probably give me better understanding of what you are thinking about.

Thanks!
Reply With Quote top
  #3  
Old 05-03-2015, 10:06 PM
Doug Nelson's Avatar
Doug Nelson Doug Nelson is offline
Janitor
 
Join Date: Aug 2001
Posts: 7,068
Blog Entries: 21
Re: First steps towards a new adjustment tool

Well, there are several fictional algorithms that would need to exist first.

First, something to examine a selected area and sort the tones from darkest to lightest. That would be the actual thing being compared to the perfect gradient. EDIT: this might not be needed, could be an extraneous step

Then you'd need another to determine a curve that would adjust said perfect gradient to match your newly-sorted tone gradient.

Then ditto on the other image. So now you have two curves.

Finally, you'd need another way to determine a curve that would transform the destination curve into the source curve. That's the curve that would actually be applied to the section of destination image.

I did warn you of fuzziness

Last edited by Doug Nelson; 05-03-2015 at 10:20 PM.
Reply With Quote top
  #4  
Old 05-04-2015, 08:31 AM
pixaeiro pixaeiro is offline
Member
 
Join Date: Feb 2015
Posts: 32
Re: First steps towards a new adjustment tool

What is the definition of perfect gradient?

I see three definitions:
Black to White.
Light intensity. in HSV or HSL, Hue is fixed and Value or Lightness increases from 0.0 to 1.0.
Light frequency. The rainbow.. I guess this is not.
Reply With Quote top
  #5  
Old 05-04-2015, 02:29 PM
Doug Nelson's Avatar
Doug Nelson Doug Nelson is offline
Janitor
 
Join Date: Aug 2001
Posts: 7,068
Blog Entries: 21
Re: First steps towards a new adjustment tool

For my mind experiment it is 0-255 gray linear RGB. But for the real application some other model might be more appropriate.
Reply With Quote top
  #6  
Old 05-05-2015, 02:40 AM
Doug Nelson's Avatar
Doug Nelson Doug Nelson is offline
Janitor
 
Join Date: Aug 2001
Posts: 7,068
Blog Entries: 21
Re: First steps towards a new adjustment tool

It is possible this already exists as Gradient Domain Image Processing. Is anyone out there already familiar with this?

EDIT: upon further googling, no this is not like GDIP, which is still very cool.

Last edited by Doug Nelson; 05-05-2015 at 03:21 AM.
Reply With Quote top
  #7  
Old 05-05-2015, 02:56 AM
Doug Nelson's Avatar
Doug Nelson Doug Nelson is offline
Janitor
 
Join Date: Aug 2001
Posts: 7,068
Blog Entries: 21
Re: First steps towards a new adjustment tool

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.
Reply With Quote top
  #8  
Old 05-05-2015, 07:29 AM
pixaeiro pixaeiro is offline
Member
 
Join Date: Feb 2015
Posts: 32
Re: First steps towards a new adjustment tool

Hi Doug,

I think I understand the description of the tool, and I will give it a try this week after I finish another tool I am developing now. From what I understand this is a linear transformation, and it's possible that there will be a lot of clamping (tone values lower than 0 or greater than 255, that are clamped to 0 and 255). But sounds interesting enough to give it a try.

About GDIP, the definition is similar to the normal maps for 3d texutring, a type a image where each color represents a normal in the surface:
Wikipedia Normal Mapping

The seamless image cloning I think is the heal tool! I have done that before, and indeed you use the neighbor pixels to find how much a pixel should blend with the background...
Reply With Quote top
  #9  
Old 05-07-2015, 06:22 PM
Doug Nelson's Avatar
Doug Nelson Doug Nelson is offline
Janitor
 
Join Date: Aug 2001
Posts: 7,068
Blog Entries: 21
Re: First steps towards a new adjustment tool

If my idea worked, and I realize that's a BIG if, I just had a nifty idea of how the interface could work (once all the backend math got worked out):

One window, with both source and destination images loaded side-by-side. You draw a line from one part of the source to the similar part in the destination. Do this several times. Maybe even with different kinds of lines. Click whatever option buttons and slide whatever sliders the math allows, and click Preview. Once you get the look you like, click Go and it makes an adjustment layer that provides the look you designed for further refinement.
Reply With Quote top
  #10  
Old 05-08-2015, 01:16 AM
klev klev is offline
Senior Member
 
Join Date: Jun 2010
Posts: 1,109
Re: First steps towards a new adjustment tool

Quote:
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.
Quote:
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.
Reply With Quote top
Reply

  RetouchPRO > Tools > Software


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RetouchPRO LIVE 3/10/2015 Learning the Pen Tool Doug Nelson RetouchPRO LIVE 8 03-14-2015 03:12 PM
Wrapping label around bottle using 3D tool. CS5 nebulaoperator Photo Compositing 7 11-11-2012 11:25 AM
Anybody sells calibrating tool for NEC PA241W? nebulaoperator Classifieds 0 07-23-2012 09:46 AM
quick selection tool when used is feathered Jerryb Photoshop Help 6 12-24-2011 04:50 AM
Drop Black tool dpnew Hidden Power Support 7 02-21-2004 11:22 AM


All times are GMT -6. The time now is 12:45 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Copyright © 2016 Doug Nelson. All Rights Reserved