Jump to content

Definition of "Adjust Saturation"


Recommended Posts

Dear fellow users,

 

I often use the "Adjustments" > "Hue/Saturation" > "Saturation" to make adjustments to single files,

but have recently had the need to do the same adjustments on a large batch of images.

 

To do this, I resorted to writing a Java program to scale the saturation of an image by a set amount,

at which point I realized that the result of simply scaling the saturation of every pixel does not match the output of paint.net.

 

My question is, does anyone know exactly what the saturation adjustment operation on paint.net does?

 

These are the things I have found out so far, when adjusting the "Saturation" of an image to, say, "150" on paint.net:

- the saturation of pixels are multiplied by 1.5, up to 1 (i.e  newSat=min(1, oldSat*1.5) )

  post-99449-0-72390900-1362297090_thumb.p

 -> Each point represents a pixel in an image that was adjusted on paint.net.  The horizontal axis is the saturation before, and the vertical is the saturation after the adjustment.

     You can see that pixels that had saturation below 1/1.5 before are scaled by (roughly) 1.5, but those above are set to 1.

 

- the value, for some reason, also changes in a similar way to the saturation. (i.e  newVal=min(1, oldVal*1.5) )

 post-99449-0-12040500-1362297084_thumb.p

 

- the hue remains constant for pixels that don't reach saturation=1, but they change in an unpredictable way for pixels with sat=1

 post-99449-0-67061300-1362297096_thumb.p

 -> the plot of the "error" in hue of each pixel, against its original saturation.

 

From the above, I can vaguely recreate the adjustments done by paint.net by scaling both value and saturation,

but not exactly because

1) the scaling of sat/value don't exactly match the scaling factor

2) the hue changes in some unpredictable way

 

I would be thankful if anyone can tell me how, exactly, paint.net adjusts an image when altering the saturation.

I hope no-one sees this as an attempt to "reverse engineer" paint.net (which it is, sort of, but not in any malicous way.)

 

Thanks in advance.

ken

Edited by kenkawakenkenke
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...