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

ExportOptionsJPEG computation and simulation

Explorer ,
Jan 16, 2023 Jan 16, 2023

Hi,

Given this parameters:

var exportOptions = new ExportOptionsJPEG();
exportOptions.antiAliasing = true;
exportOptions.horizontalScale = 500;
exportOptions.verticalScale = 500;
exportOptions.qualitySetting = 100;

How did it come up with this properties(see dimensions and resolution properties)?

image prop.pngexpand image

May I know the computation for this?

Also when exporting JPEG in illustrator, the UI show this:

jpeg opt.pngexpand image

How can I simulate those values using the scripting way(ExportOptionsJPEG)

TOPICS
Import and export , Scripting
757
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

correct answers 1 Correct answer

Community Expert , Jan 17, 2023 Jan 17, 2023

That would suggest you are exporting from a 387 x 644 px document in Illustrator?

As I said, there is no PPI setting in ExportOptionsJPEG.

If you want a 1613x2682 px file, I suggest you create an artboard that size and use horizontal/verticalScale of 100.

 

Provision for applying PPI appears to have been introduced with the Export for Screens options. See here for some discussion, especially Carlos's post:

https://community.adobe.com/t5/illustrator-discussions/export-jpg-as-300-ppi/m-p/11244200

Translate
Adobe
Community Expert ,
Jan 16, 2023 Jan 16, 2023

horizontal/verticalScale is a percentage (e.g. 500% in that instance).

qualitySetting is the compression level (100 = no/minimum compression).

 

What are the dimensions of the original file?

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 ,
Jan 16, 2023 Jan 16, 2023

See attached for the exact AI file.

This is the image generated using Export as JPEG via illustrator UI

mariahannad92609693_0-1673872146983.pngexpand image

 

filename_11223161218-exported.jpgexpand image

This is the image generated using ExportOptionsJPEG via scripting

filename_11223161218.ai.jpgexpand image

 

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 ,
Jan 16, 2023 Jan 16, 2023

Here the details of exported image via Illustrator UI

export via ai ui.pngexpand image

 

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
Community Expert ,
Jan 16, 2023 Jan 16, 2023

Your first post shows different settings (72 PPI and CMYK ve 300 PPI RGB). Which do you want to achieve?

There is no PPI setting in ExportOptionsJPEG. Do you want a particular pixel size or a particular real-world size (inches or cm)?

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 ,
Jan 17, 2023 Jan 17, 2023

It's 300 PPI RGB.

I just wanted to know how to simulate the export JPEG in illustrator UI on ExportOptionsJPEG script.

For example: on export UI I selected this options: 300 PPI RGB and then it produces an image with 1613x2682 dimension and 300x300 dpi. What values(vertical/horizontal scale) should I added to ExportOptionsJPEG script to produce the same image?

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
Community Expert ,
Jan 17, 2023 Jan 17, 2023
LATEST

That would suggest you are exporting from a 387 x 644 px document in Illustrator?

As I said, there is no PPI setting in ExportOptionsJPEG.

If you want a 1613x2682 px file, I suggest you create an artboard that size and use horizontal/verticalScale of 100.

 

Provision for applying PPI appears to have been introduced with the Export for Screens options. See here for some discussion, especially Carlos's post:

https://community.adobe.com/t5/illustrator-discussions/export-jpg-as-300-ppi/m-p/11244200

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 ,
Jan 16, 2023 Jan 16, 2023

You did nothing to set ppi in your code. It is not calculated from your unrelated options. It is not set at all. 96 is a default shown by some viewers; others show a default of 72. 

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 ,
Jan 17, 2023 Jan 17, 2023

Hi,

I'm just following the guide here: https://ai-scripting.docsforadobe.dev/jsobjref/ExportOptionsJPEG.html

How do I set the PPI 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