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

Measuring the area of an artwork

Community Beginner ,
Dec 04, 2023 Dec 04, 2023

Copy link to clipboard

Copied

For the purposes of silk screen printing, I would separate the artwork into individual layers based on color, convert all colors to black, and print each layer separately. In order to estimate the ink consumption, I'd like to determine the 'area' of black ink on each layer, sum them up, and compare the total ink usage to another artwork to identify which one requires more ink. This information is crucial for cost estimation purposes. Is there a method for determining the black ink area on each layer?

TOPICS
How-to , Tools

Views

233
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
Adobe
Guide ,
Dec 05, 2023 Dec 05, 2023

Copy link to clipboard

Copied

The total area of a fill color could be obtained with a script, but this will not include strokes. 

 

 

Votes

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 Beginner ,
Dec 05, 2023 Dec 05, 2023

Copy link to clipboard

Copied

Thanks for the reply. That will do, since artworks for silkscreen do not use strokes. How is the script done?

Votes

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 Beginner ,
Dec 05, 2023 Dec 05, 2023

Copy link to clipboard

Copied

I tried this script below but it wouldn't work:

// Adobe Illustrator script to calculate total area of a fill color in a PDF file

// Function to calculate the area of a path item
function calculateArea(pathItem) {
var area = 0;

// Check if the pathItem has a fill color
if (pathItem.filled) {
// Get the color of the fill
var fillColor = pathItem.fillColor;

// Check if the fill color is a solid color
if (fillColor instanceof RGBColor) {
// Calculate the area of the pathItem
area += pathItem.area;
}
}

return area;
}

// Main function to calculate total area
function calculateTotalArea() {
var doc = app.activeDocument;
var totalArea = 0;

// Loop through all page items in the document
for (var i = 0; i < doc.pageItems.length; i++) {
var currentItem = doc.pageItems[i];
totalArea += calculateArea(currentItem);
}

// Display the total area
alert("Total Fill Color Area: " + totalArea.toFixed(2) + " square units");
}

// Run the main function
calculateTotalArea();

Votes

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 Beginner ,
Dec 05, 2023 Dec 05, 2023

Copy link to clipboard

Copied

LATEST

Thank you for the tip! This script below worked.

function calculateArea(pathItem) {
var area = 0;

// Check if the pathItem has a fill color
if (pathItem.filled) {
// Get the color of the fill
var fillColor = pathItem.fillColor;

// Check if the fill color is a solid color
if (fillColor instanceof RGBColor || fillColor instanceof CMYKColor || fillColor instanceof GrayColor) {
// Calculate the area of the pathItem
area += pathItem.area;
}
}

return area;
}

function calculateTotalArea() {
var doc = app.activeDocument;
var totalArea = 0;

// Loop through all page items in the document
for (var i = 0; i < doc.pageItems.length; i++) {
var currentItem = doc.pageItems[i];
totalArea += calculateArea(currentItem);
}

// Display the total area
alert("Total Fill Color Area: " + totalArea.toFixed(2) + " square units");
}

calculateTotalArea();

Votes

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