HI
can anyone please guide me. I have images which i want to align/use based on there brightness values. Like bright images should be used first and then the darker images
Can we get the brightness of each image through some code
Did you try document histogram?
I would recommen this as well
Unless it’s the very same framing of the very same subject (e.g. a bracketed exposures) the histogram analysis per se might fail, otherwise it can be a viable option.
How to use histogram ![]()
i wanted to align the image based on two parameters
- Brightness
- dominant color
like forexample
get all RED color dominant images and align left top area and then further sub align on brightness values
If you want dominant color you could try to convert image into Indexed Color mode and set colors e.g. to 2 colors with black and white not enforced without dithering. Then you could convert into RGB and read histogram for red, green and blue to find what those 2 colors are. …or something like that.
“Can we get the brightness of each image through some code?”
Do you mean here ‘images’ or ‘pixels’?
For pixels you can use Y’=0.299R’+0.587G’+0.114B’ which gives luminance (or greyshade) as a function of the red, green and blue channel values.
If you meant ‘images’, then you can perform the above calculation for each pixel in an image and then average those values across the image to get the average brightness of the image.