# Last edited on 2001-12-16 12:40:03 by stolfi # Converts photos of fragment piles into ".eps" format. IMG = iab-7 ROT = -3 CLIP = 61 162 1112 816 SCALE = 0.75 NORM = -bpercent 2 -wpercent 14 GAMMAOUT = 1.0 # IMG = iab-1 # ROT = -4 # CLIP = 28 83 290 312 # SCALE = 1.0 # NORM = -bpercent 1 -wpercent 8 # GAMMAOUT = 1.0 # IMG = iab-2-x # ROT = 0 # CLIP = 35 10 680 500 # SCALE = 1 # NORM = -bpercent 1 -wpercent 8 # GAMMAOUT = 1.0 # IMG = brmus-1 # ROT = -33 # CLIP = 330 695 1268 402 # SCALE = 0.5 # NORM = -bpercent 1 -wpercent 8 # GAMMAOUT = 1.0 .PHONY: all clean all: ${IMG}-norm.eps clean: /bin/rm -f ${IMG}-*.ppm ${IMG}-*.pgm ${IMG}-*.eps # Convert from png to ppm, cut, convert to grayscale: ${IMG}-rot.pgm: ${IMG}.png convert ${IMG}.png /tmp/${IMG}.ppm cat /tmp/${IMG}.ppm \ | pnmrotate ${ROT} \ > ${IMG}-rot.ppm ${IMG}-cut.pgm: ${IMG}-rot.pgm cat ${IMG}-rot.ppm \ | pnmcut ${CLIP} \ | pnmgamma 1.2 \ | ppmtopgm \ | pnmscale ${SCALE} \ | pnmdepth 255 \ > ${IMG}-cut.pgm /bin/rm -f /tmp/${IMG}.ppm xv ${IMG}-cut.pgm ${IMG}*.p?m # Generate a smoothed version of the image: ${IMG}-smooth.pgm: ${IMG}-cut.pgm cat ${IMG}-cut.pgm \ | pnmsmooth | pnmsmooth | pnmsmooth | pnmsmooth | pnmsmooth \ > /tmp/${IMG}-s.pgm cat /tmp/${IMG}-s.pgm \ | pnmsmooth | pnmsmooth | pnmsmooth | pnmsmooth | pnmsmooth \ > /tmp/${IMG}-ss.pgm cat /tmp/${IMG}-ss.pgm \ | pnmsmooth | pnmsmooth | pnmsmooth | pnmsmooth | pnmsmooth \ > /tmp/${IMG}-sss.pgm cat /tmp/${IMG}-sss.pgm \ | pnmsmooth | pnmsmooth | pnmsmooth | pnmsmooth | pnmsmooth \ > ${IMG}-smooth.pgm xv ${IMG}-smooth.pgm ${IMG}*.p?m # Subtract smmothed image from original, normalize: ${IMG}-norm.pgm: ${IMG}-cut.pgm ${IMG}-smooth.pgm pnmxarith -mix 3.0 -2.0 ${IMG}-cut.pgm ${IMG}-smooth.pgm \ | pgmnorm ${NORM} \ | pnmdepth 255 \ > ${IMG}-norm.pgm xv ${IMG}-norm.pgm ${IMG}*.p?m # Convert to Postscript: ${IMG}-norm.eps: ${IMG}-norm.pgm cat ${IMG}-norm.pgm \ | pnmgamma ${GAMMAOUT} \ | pnmdepth 255 \ | pnmtopsx -noturn \ > ${IMG}-norm.eps ghostview ${IMG}-norm.eps # ====================================================================== # Special rules to remove highlights from iab-2.png: iab-2.ppm: iab-2.png convert iab-2.png ppm:- \ | pnmgamma 0.85 \ | pnmscale 0.5 \ | pnmdepth 255 \ > iab-2.ppm xv iab-2.ppm iab-2-x.ppm: iab-2.ppm remove-highlights 77 65 43 0.5 \ < iab-2.ppm \ > iab-2-x.ppm \ || { /bin/rm -f iab-2-x.ppm ; exit 1; } xv iab-2-x.ppm iab-2-x.png: iab-2-x.ppm convert iab-2-x.ppm iab-2-x.png