Photoshop Nearest Neighbor Resampling
Photoshop Nearest Neighbor Resampling
- Subject: Photoshop Nearest Neighbor Resampling
- From: John Ward <email@hidden>
- Date: Fri, 03 Oct 2003 12:55:17 -0600
This may be of interest to those who like to analyze or modify test
charts. It is well known that nearest neighbor (NN) resampling is the
right way to scale a test chart while preserving the values of the
colors in the patches. For example the single pixel per patch output
TIFFs from ColorLab can be scaled to whatever print size is of interest.
The analysis of existing test charts is more trouble. Often there are
white or black spaces between the patches. Moreover, the tedious task of
reading patches with the Photoshop eyedropper fails for L* and CMYK
values because only integers are returned instead of the true 8-bit
values encoded in the file. Thus I used to do lots of Photoshop surgery
to get rid of intervening borders before using NN resampling to reduce
the file to single pixel per patch size for analysis in ColorLab.
Then I discovered that NN resampling will sample intervening borders to
oblivion. I crop out
perimeter information such as chart name and column/row labels so there
are just the color patches and intervening interior borders. Then NN
resample directly to the single pixel per patch dimensions appropriate
for the chart -- for example, 4 x 6 pixels for the classic Color
Checker.
The worry, of course, is that residual effects from the border color may
contaminate the final pixel values. Initial testing was done with the
GretagMacbeth TC2.88 RGB file in which the ratio of linear patch size to
white border is 19. Next up was the Candela digital Color Checker
(picto.com) with a patch size to black border ratio of 8. Finally, a
synthesized version of the Color Checker with patch to border ratio of 2
was tried. In all cases there were no errors. Here I was comparing the
resampled file to known results. A skeptic could test the procedure by
selecting the interior borders in Photoshop, filling them with a
different color, resampling again, and comparing the resulting files.
My guess is the NN algorithm converges (or jumps) to some interior pixel
value discarding everything else along the way. As such, it could NOT be
used to extract average color patch information from a scanned or
photographed target containing noise. There may be a useful application
here for Photoshop Filter Factory -- average the values in each scanned
color patch before NN resampling.
This work was done with Photoshop 5x (PC) and 6 (Mac). Hopefully
versions 7 and beyond function similarly.
Finally, I apologize if these results are well known to everyone except
me or similar results have been recently posted -- I am months in
arrears reading my digests, as usual.
John
_______________________________________________
colorsync-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/colorsync-users
Do not post admin requests to the list. They will be ignored.