Copy link to clipboard
Copied
Hello -
I made a small Javascript that export all/some artboards with the below parameters cfr. screenshot).
But for a reason or another the profile is incorrect. It's sRGB when it must be Adobe RGB (1998).
Do I miss something, or is it a limitation of the "system" (as pretend AI like Claude).
If it isn't a liitation, what the correct line code to embed Adobe RGB profile?
app.activeDocument.colorProfileName = 'Adobe RGB (1998)';"
…
var jpegOptions = new JPEGSaveOptions();
jpegOptions.quality = 10;
jpegOptions.embedColorProfile = true;
Many thanks for any feedback
Enjoy your day.
- Dimitri
Hi @dimitri_cas remarkably Illustrator doesn't provide the spripting API with access to assigning ICC profiles. Literally all we can do is see what profile is assigned (read only). Even Actions can't seem to assign them. Not good.
In your case, do you need to assign the profile and then export the jpg, or have you already assigned the desired profile? If you already have the correct profile assigned, you can use exportForScreens and set the `includeICCProfile` to true.
Something like this fu
...Copy link to clipboard
Copied
Hi @dimitri_cas remarkably Illustrator doesn't provide the spripting API with access to assigning ICC profiles. Literally all we can do is see what profile is assigned (read only). Even Actions can't seem to assign them. Not good.
In your case, do you need to assign the profile and then export the jpg, or have you already assigned the desired profile? If you already have the correct profile assigned, you can use exportForScreens and set the `includeICCProfile` to true.
Something like this function I used for something a while ago:
/**
* Export all artboards as JPG.
* @author m1b
* @version 2024-10-18
* @param {Document} doc - an Illustrator Document.
* @param {Folder} [exportFolder] - the folder to export to (default: document's folder).
*/
function exportJPG(doc, exportFolder) {
var options = new ExportForScreensOptionsJPEG();
options.antiAliasing = AntiAliasingMethod.ARTOPTIMIZED;
options.compressionMethod = JPEGCompressionMethodType.BASELINESTANDARD;
options.embedICCProfile = true;
options.scaleType = ExportForScreensScaleType.SCALEBYFACTOR;
options.scaleTypeValue = 1;
var itemToExport = new ExportForScreensItemToExport();
itemToExport.artboards = 'all';
itemToExport.document = false;
exportFolder = exportFolder || doc.path;
doc.exportForScreens(exportFolder, ExportForScreensType.SE_JPEG100, options, itemToExport);
};
(you will have to adjust the settings to suit your situation.)
However if you need to export as a different profile than the actual .ai document, the only way I can think of is to (1) export as JPG from Illustrator (or better: a lossless format, eg flat psd) then (2) use BridgeTalk later in the same script to tell Photoshop to open the exported image file and assign the desired ICC profile, then save it (or save as/export as JPG).
Sorry it isn't an easy answer.
- Mark
Copy link to clipboard
Copied
Hello m1b 🙂
Let's be honest, you rock 🤘
I think it will make a very good base (starting point) for what I need.
As you said, of course, I'll have to improve it. But I'm quiet optimist 😀
NB. I dunnon didn't thought about this "Export for Screens…", May be cuz I never use this "option".
Thanks a lot…
- Dimitri
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more