Copy link to clipboard
Copied
I'm a newbie to Photoshop scripting so please bear with me.
Working in VB, in Photoshop 7 (yes, 7, don't ask) and am getting an error trying to use the ChangeMode command. The image is starting life as a Bitmap and the ChangeMode works fine for converting it to Grayscale but when I try to go back to Bitmap I get the error "the argument is not valid."
Even if I don't actually DO anything to the document between the conversions I still get the error. Converting to CMYK works fine as does changing to RGB, it's just the silly psConvertToBitmap that won't work.
A simplified version of the code looks like this:
Set PSDoc = PSApp.ActiveDocument
Call PSDoc.ChangeMode(psConvertToRGB)
Call PSDoc.ChangeMode(psConvertToBitmap)
Any help would be most appreciated.
All Best,
Ken
Copy link to clipboard
Copied
With JS bitmap and index mode need a second parameter setting the conversion options. You also need to convert color images to greyscale before conerting to bitmap.
I would imagine that it is the same in VB
Copy link to clipboard
Copied
That seems to make sense.
Any idea where I can get info on how to pass those options? I've checked all the PDFs that come with the scripting download but can't seem to find anything.
Many thanks for your time.
Ken
Copy link to clipboard
Copied
The info on BitmapConversionOptions is on page 38 of the CS4 VBS guide.
With javascript if you want to use the default conversion options you do something like this:
activeDocument.changeMode( ChangeMode.BITMAP, new BitmapConversionOptions );// doc must be greyscale
Find more inspiration, events, and resources on the new Adobe Community
Explore Now