Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: greyscale black and white B&W colour
AddExtender("wwimg34i.dll") Bright= 100 ;no adjustment Sat= 0 ;grayscale Hue= 100 ;no adjustment BSH=StrCat(Bright,",",Sat,",",Hue) infile="color.jpg" outfile="BlackandWhite.jpg" ImgModulate(infile,outfile,BSH) ;Brightness, Saturation, Hue
AddExtender("WWIMG44I.DLL") Bright= 100 ;no adjustment Sat= 0 ;grayscale Hue= 100 ;no adjustment BSH=StrCat(Bright,",",Sat,",",Hue) infile ="color.bmp" outfile="blackandwhite.bmp" ImgModulate(infile,outfile,BSH) ;Convert to black-and-white ;this will convert it to 8-bit (256 colors) ext = StrUpper(FileExtension(outfile)) If ext!="JPG" && ext!="GIF" ;if we didn't already convert to a JPG or GIF, then do so now outfile_8bit=StrCat(FileRoot(outfile),".gif") ;GIF looks better than a JPG ImgConvert(outfile,outfile_8bit) ;convert to a black-and-white GIF...should be 256 colors now ImgConvert(outfile_8bit,outfile) ;convert it back to its original format...should stay 256 colors FileDelete(outfile_8bit) ;remove temporary GIF EndIfor, even cleaner (ImgModulate can convert at the same time...this way only requires one call to ImgConvert):
AddExtender("WWIMG44I.DLL") Bright= 100 ;no adjustment Sat= 0 ;grayscale Hue= 100 ;no adjustment BSH=StrCat(Bright,",",Sat,",",Hue) infile ="color.bmp" outfile="blackandwhite.gif" ;make the outfile a GIF ImgModulate(infile,outfile,BSH) ;convert to black and white GIF...should be 8-bits now (256 colors) ImgConvert(outfile,StrCat(FileRoot(outfile),".bmp")) ;convert it back to BMP...should stay 256 colors FileDelete(outfile) ;remove temporary GIF
Article ID: W16843
File Created: 2014:01:29:15:34:52
Last Updated: 2014:01:29:15:34:52