0

Looking at the Brightness and Contrast classes in ImageEnhance:

https://pillow.readthedocs.io/en/stable/reference/ImageEnhance.html

The image is in RGB mode, 8 bits per channel.

I could apply Brightness first, then Contrast to the same image. Or I could choose the opposite order.

Does it make a difference? If it does, is there a recommended order?

Would the recommendation change if the image was in L mode, 8 bits per pixel?

Florin Andrei
  • 1,067
  • 3
  • 11
  • 33
  • Personally I tend to avoid all of the *enhance* methods because I find it difficult to guess what parameters might be useful and all a bit arbitrary. They are ok if you are writing a GUI and you provide sliders allowing interactive users to *"tweak"* the look of an image. – Mark Setchell Mar 30 '23 at 08:37
  • @MarkSetchell Tweaking the image in an exploratory way is exactly what I'm trying to accomplish. – Florin Andrei Mar 30 '23 at 17:19
  • If you want to experiment and tweak images interactively, maybe look at https://www.photopea.com/ and ImageJ here https://ij.imjoy.io/ – Mark Setchell Mar 31 '23 at 19:14

1 Answers1

1

it depends on what you want to achieve. If you need to enhance the details then contrast first. If you need brightness overall then brightness first. According to docs brightness it'll make all pixels brighter/darker. Contrast will make the bright pixels brighter and the dark pixels darker, but middle gray values will keep unchanged.

RAI
  • 584
  • 9