Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

ChangeMode Error

Guest
Jul 24, 2009 Jul 24, 2009

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

TOPICS
Actions and scripting
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Guru ,
Jul 24, 2009 Jul 24, 2009

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 26, 2009 Jul 26, 2009

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jul 27, 2009 Jul 27, 2009
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines