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

How to transform a binary image into jpg or png in script

Explorer ,
Apr 15, 2021 Apr 15, 2021

There is a way to transform a binary image into jpg or png via script?

 

I tried to do this by inserting the binary image but it returns an error look;

 


// =======================================================
var idPlc = charIDToTypeID( "Plc " );
var desc873 = new ActionDescriptor();
var idIdnt = charIDToTypeID( "Idnt" );
desc873.putInteger( idIdnt, 110 );
var idnull = charIDToTypeID( "null" );

var image1_imgString = // here would be the binary image

desc873.putPath( idnull, new File( image1_imgString ) );

var idFTcs = charIDToTypeID( "FTcs" );
var idQCSt = charIDToTypeID( "QCSt" );
var idQcsa = charIDToTypeID( "Qcsa" );
desc873.putEnumerated( idFTcs, idQCSt, idQcsa );
var idOfst = charIDToTypeID( "Ofst" );
var desc874 = new ActionDescriptor();
var idHrzn = charIDToTypeID( "Hrzn" );
var idPxl = charIDToTypeID( "#Pxl" );
desc874.putUnitDouble( idHrzn, idPxl, 0.000000 );
var idVrtc = charIDToTypeID( "Vrtc" );
var idPxl = charIDToTypeID( "#Pxl" );
desc874.putUnitDouble( idVrtc, idPxl, 0.000000 );
var idOfst = charIDToTypeID( "Ofst" );
desc873.putObject( idOfst, idOfst, desc874 );
executeAction( idPlc, desc873, DialogModes.NO );

 




TOPICS
Actions and scripting
719
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
LEGEND ,
Apr 15, 2021 Apr 15, 2021
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
Explorer ,
Apr 15, 2021 Apr 15, 2021

did not open

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
LEGEND ,
Apr 15, 2021 Apr 15, 2021
LATEST

Of course, you need some pattern that maybe someone will provide over here 😉

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