How to color select all colors in a gradient?
Posted: 2013-11-27T07:55:25-07:00
Is it possible using command line scripts to do a color select of all the colors found in a gradient?
This relates to my posts about trying to black-fill the shadow area around the edge of scanned postage stamps that were scanned on a colored background. (Scanning on black background is not possible for reasons described in those posts).
- I would like to experiment with selecting the greenish colors in the shadow area around the edges of the stamps. To know those colors, I could make an image that contains those colors (i.e. an image of the gradient).
- I would like to add those colors to the selection of the background color that is being done in this script, but I don't have a clue how to do that. Note that the selection needs to be in the "background region" not in the foreground, i.e. not in the stamp design itself. In a crude way, I envision this working by checking each pixel that is adjacent to the already-selected background area and if that pixel's color is in the "list" of colors found in the gradient, then selecting it also.
http://jsa.viewimage.net/temp/im/bg_rem ... modified.s
Is this even possible?
=====
The source file coming from the scanning process is here:
*** I am posting a JPEG version for easy web viewing purposes.
http://jsa.viewimage.net/temp/im/source.jpg
*** The original TIFF version is here:
http://jsa.viewimage.net/temp/im/source.tif (5.5 MB)
The current result of the script process is here -- you really have to magnify the image to see the problem (the green shadows along the tops of the stamps' perforations):
http://jsa.viewimage.net/temp/im/result-2.tif (5.5 MB)
This relates to my posts about trying to black-fill the shadow area around the edge of scanned postage stamps that were scanned on a colored background. (Scanning on black background is not possible for reasons described in those posts).
- I would like to experiment with selecting the greenish colors in the shadow area around the edges of the stamps. To know those colors, I could make an image that contains those colors (i.e. an image of the gradient).
- I would like to add those colors to the selection of the background color that is being done in this script, but I don't have a clue how to do that. Note that the selection needs to be in the "background region" not in the foreground, i.e. not in the stamp design itself. In a crude way, I envision this working by checking each pixel that is adjacent to the already-selected background area and if that pixel's color is in the "list" of colors found in the gradient, then selecting it also.
http://jsa.viewimage.net/temp/im/bg_rem ... modified.s
Is this even possible?
=====
The source file coming from the scanning process is here:
*** I am posting a JPEG version for easy web viewing purposes.
http://jsa.viewimage.net/temp/im/source.jpg
*** The original TIFF version is here:
http://jsa.viewimage.net/temp/im/source.tif (5.5 MB)
The current result of the script process is here -- you really have to magnify the image to see the problem (the green shadows along the tops of the stamps' perforations):
http://jsa.viewimage.net/temp/im/result-2.tif (5.5 MB)