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

ExportOptionsJPEG computation and simulation

Explorer ,
Jan 16, 2023 Jan 16, 2023

Copy link to clipboard

Copied

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.png

May I know the computation for this?

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

jpeg opt.png

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

TOPICS
Import and export , Scripting

Views

227

Likes

Translate

Translate

Report

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

Likes

Translate

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

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

See attached for the exact AI file.

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

mariahannad92609693_0-1673872146983.png

 

filename_11223161218-exported.jpg

This is the image generated using ExportOptionsJPEG via scripting

filename_11223161218.ai.jpg

 

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Here the details of exported image via Illustrator UI

export via ai ui.png

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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)?

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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. 

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Hi,

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

How do I set the PPI here?

Likes

Translate

Translate

Report

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