myspacee wrote:anyone can help to adjust linux script to obtain working example for windows geeks ?
This part is the main problem, as you noted:
- Code: Select all
HISTO=`convert "$TEMP_FILE" histogram:- | identify -format %c - | grep -vre "black\|white"`
As far as I know, Windows cannot do anything remotely like it. The back-quotes, for instance, are just a fantasy for Windows programmers, I believe. And then redirection of an image via standard input and output --- Windows would choke on it. (Someobody correct me if I am wrong!)
But a batch file is doable, I'l bet, with loads of work. I suspect you need to write the histogram to a separate file and then use identify on that if you want to replicate the rest of your process.
But I also suspect that there is a much easier way to achieve a similar effect without resorting to the histogram. Something along these lines:
- Code: Select all
convert ( warhol-in.jpg -colorspace gray -colors 3 ) ( -size 3x1 xc:white -fill red -draw "color 0,0 point" -fill green -draw "color 1,0 point" -fill blue -draw "color 2,0 point" ) -interpolate integer -clut cat.gif
Most of that is just to get the three colors into a 3-pixel file that can them be used for color replacement using -clut, and there is surely a more elegant way to create a 3-pixel file.
Rick