[SOLVED] 128-step greyscale image source

Pimpom

Distinguished
May 11, 2008
445
28
18,940
I've made several greyscale test images for my own use in the past. The latest is a 6-bit FHD image patterned as 65 columns of grey shades from 0, 0, 0 to 255, 255, 255 in equal steps. Among other things, it helps me set the brightness and contrast levels of my display.

Now I'd like to have a 128-step image. I could create it with the same fully manual process I used before, but it's very tedious and I'd like to avoid it if possible. Can anyone please point me to a free readymade image?
 
Solution
Test patterns can be generated easily with Matlab. How did you want to handle the ends? 0–255 is an even number of colors, so skipping numbers and maintaining even spacing will leave off a color on the ends (the pattern with be either [0, 2, 4, ... , 254], or [1, 3, 5, ... , 255]). Do you want to just include 0, 1 at the beginning, or 254, 255 at the end?
17b.jpg

here some random picture
contains 5 horizontal grey patterns
128 is on second horizontal line
 

Pimpom

Distinguished
May 11, 2008
445
28
18,940
Thank you, that's almost perfect. I hate to nitpick but I say 'almost' because the image is a jpeg and the compression causes variations in the luminance of individual pixels within a single column. A quick check indicates that this variation is up to ±2 luminance levels, possibly more.

Any chance of finding a similar image in a lossless format like PNG or TIFF ?
 
Test patterns can be generated easily with Matlab. How did you want to handle the ends? 0–255 is an even number of colors, so skipping numbers and maintaining even spacing will leave off a color on the ends (the pattern with be either [0, 2, 4, ... , 254], or [1, 3, 5, ... , 255]). Do you want to just include 0, 1 at the beginning, or 254, 255 at the end?
 
Solution
View: https://i.imgur.com/kRsTPRp.png


I've made one that switches from even numbers to odd numbers in the center (it goes 0–128 by twos, then 129–255 by twos.

Code:
% MATLAB %
HRES = 1920;
VRES = 1080;
STEPS = 128;
START = 0;
END = 255;

Step_Vector = round(linspace(0, STEPS, HRES));
Scale_Vector = linspace(STEPS, STEPS, HRES);
Greyscale_Vector = uint8(Step_Vector .* (END ./ Scale_Vector));

RGB = uint8(zeros(VRES, HRES, 3));
for col = 1:HRES
    RGB(:, col, :) = uint8(Greyscale_Vector(col));
end

% imshow(RGB);
imwrite(RGB,sprintf('Greyscale Test Pattern (%d–%d, %d Steps).png',START,END,STEPS));
 
  • Like
Reactions: sgsharkie

Pimpom

Distinguished
May 11, 2008
445
28
18,940
Thanks for your interest. I don't know how to use Matlab but the concept is easy to understand. How to utilize the horizontal pixels was a problem I faced when manually drawing the greyscale in 1920 and earlier (lower) resolutions. For example, intuition suggests that 0-255 levels of grey could be evenly divided into stepped levels numbering 32, 64, etc. whereas we need 33, 65, etc. to include both 0 and 255.

This is what I did in creating the 64-level greyscale: Create 65 columns of 29 pixels each from 0-255. This totals 1885 pixels, leaving 35 extra pixels from 1920. I added 17 pixels of black and 18 pixels of white at the left and right sides respectively. Similarly for 32 and 16 levels.

It gets a bit awkward for 129 levels. 129x14 = 1806, leaving 114 'extra' pixels. One possibility is to alternate 14 and pixels, leaving only 49 pixels for the ends.

Anyway, it's getting close to midnight here and I have to attend to other matters. Can I get back to you tomorrow? Thanks again.
 
Thanks for your interest. I don't know how to use Matlab but the concept is easy to understand. How to utilize the horizontal pixels was a problem I faced when manually drawing the greyscale in 1920 and earlier (lower) resolutions. For example, intuition suggests that 0-255 levels of grey could be evenly divided into stepped levels numbering 32, 64, etc. whereas we need 33, 65, etc. to include both 0 and 255.

This is what I did in creating the 64-level greyscale: Create 65 columns of 29 pixels each from 0-255. This totals 1885 pixels, leaving 35 extra pixels from 1920. I added 17 pixels of black and 18 pixels of white at the left and right sides respectively. Similarly for 32 and 16 levels.

It gets a bit awkward for 129 levels. 129x14 = 1806, leaving 114 'extra' pixels. One possibility is to alternate 14 and pixels, leaving only 49 pixels for the ends.

Anyway, it's getting close to midnight here and I have to attend to other matters. Can I get back to you tomorrow? Thanks again.
I made one for you already, not sure if you missed it :p
 
I've made several greyscale test images for my own use in the past. The latest is a 6-bit FHD image patterned as 65 columns of grey shades from 0, 0, 0 to 255, 255, 255 in equal steps. Among other things, it helps me set the brightness and contrast levels of my display.

Now I'd like to have a 128-step image. I could create it with the same fully manual process I used before, but it's very tedious and I'd like to avoid it if possible. Can anyone please point me to a free readymade image?

It's nice that you are doing the work yourself, but you don't need to. There are tons of display calibration images and utilities already out there. Without some actual calibration hardware I doubt you will have any issues using even a compressed image, your eyes, ability to tell minor differences and display variations will have as much as a margin of error as what compression does to an image. I worked in hospitals and have done lots of display calibration, for some very expensive screens and video cards, there is a decent margin of acceptable variations even there and that is with monitors that cost $5,000 and $1,000 video cards and calibration hardware.