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

White Space vs Pictures vs Words

Community Beginner ,
May 30, 2023 May 30, 2023

Copy link to clipboard

Copied

Is there a way to measure the White space in an InDesign file in comparison to the amount of space Text takes up and Images take up? This will help my company know if a book has too many images or too much white space or too many words.

 

For example: The document is considered 100% filled. Perhaps 10% of the document is filled with images, 30% of the file is take up with text / words, and 60% is filled with white space. 10% + 30% + 60% = 100% of the document.

 

Could all the white pixels be counted and compared to all the colored pixels maybe to determine this ratio?

TOPICS
Experiment , Feature request , How to , Import and export , Print

Views

651

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 ,
May 30, 2023 May 30, 2023

Copy link to clipboard

Copied

I'd question whether any formula could usefully be applied to such a (largely) esthetic judgment, but it's all about the numbers in some shops.

 

InDesign has no integral features that would enable this, maybe not even through scripting. As you suggest, it may need an entirely optical process based on page images. 


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

Votes

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 Beginner ,
May 31, 2023 May 31, 2023

Copy link to clipboard

Copied

Do you have any other suggestions of how the problem could be solved? 

Votes

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 ,
May 31, 2023 May 31, 2023

Copy link to clipboard

Copied

I think a script could be devised to tally image and text areas, then calculate proportions against page size. Fairly complex and there are some gotchas, such as text frame area vs actual text content. 

 

Would probably be a paid development job,  but there are wizard script folks here.


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

Votes

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 Beginner ,
May 31, 2023 May 31, 2023

Copy link to clipboard

Copied

Where can I go to pay a wizard to write a script of code for this problem? 

Votes

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 ,
May 31, 2023 May 31, 2023

Copy link to clipboard

Copied

Could all the white pixels be counted and compared to all the colored pixels maybe to determine this ratio?

 

Hi @PensacolaChri30005758izls , InDesign pages are vector objects—there are no pixels—so I don’t think you could reliably get a white space percentage from the InDesign scripting API. You could export a page to an image format, and maybe get a white pixel percentage in Photoshop—InDesign and Photoshop can talk to each other via the Bridgetalk object.

 

Maybe ask over in the Photoshop forum for a script that will get a count of white pixels divided by total pixels from an image file. Then you could either manually export the page and run the script in Photoshop, or use Bridgetalk to launch the script fom inDesign.

Votes

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 ,
May 31, 2023 May 31, 2023

Copy link to clipboard

Copied

Looks like it is fairly straight forward to get an RGB image’s white pixels via the Photoshop document’s histogram property, which is an array of 256 values. So if you export to a PNG using this setting—note I have all Options unchecked:

 

Screen Shot 3.png

 

Then run this Photoshop script on the exportd PNG doc:

 

 

 

app.preferences.rulerUnits = Units.PIXELS;
var d = app.activeDocument;

//the doc‘s total pixels
var t = d.height* d.width;

//the count of pixels in the histogram array‘s 255 index (white pixels)
var w = d.histogram[255];
alert("White Pixel Percentage = " + (w/t)*100);

 

 

 

The result:

 

Screen Shot 4.png

Votes

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 ,
May 31, 2023 May 31, 2023

Copy link to clipboard

Copied

I'm not sure that results in anything meaningful, as it's counting all the inter-text space as white, and text runs, what, about 20-25% of its area?

 

I think the OP's question could be answered with scripting, but it would get pretty hairy:

  • Start with the area of the page.
  • Find and calculate the area of all images. Subtract.
  • Find and calculate the area of all text frames. Subtract.

 

...except that a 3x4 inch image might be just an L-shaped corner scroll, with 90% effective white space. Or a shape/object on a fairly large white background that would have to be esthetically evaluated as "white space."

 

...except that a text frame might not be filled to the bottom.

 

...except that there could be overlap of elements of both types.

 

But, sufficiently redundant script evaluation could iron out most of these gaps and give a fairly accurate white space calculation, especially across many pages. But it's not a job I'd expect one of the crew here to whip together for free... especially as I maintain it's a questionable goal, approach and result in the first place. I'm not sure a mathematical evaluation of white space would mean... a darn useful thing.


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

Votes

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

Copy link to clipboard

Copied

Thank you for the comment. I will keep it in mind as I experiment with the reply that your comment is in response to. You definitely understand the issue at hand! Yay! We had one book that is 50 pages longer than another book because (hypothesis) more images were added to the bigger one (not more words). This is why the problem arose and why they are trying to standardize this process with data analytics (me). Whoo hoo... 

 

When you say "it's not a job I'd expect one of the crew here to whip together for free"  - is there someone that could be paid to help me and my company to resolve this problem? Making Art into Numbers is sooo tricky. When you say, "sufficiently redundant script evaluation," does that mean taking formula from  the comment above yours and doing it over and over again to find what my managers are looking for? I truly appreciate your taking the time to read through this and comment on it. 

Votes

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

Copy link to clipboard

Copied

Thank you for this advice! I am sorry the problem is so confusing. Unfortunately, my managers thought it best to add it to my analyst-ing to-do list. To accomplish this impossible task I have been assigned (despite objections), I am willing to try taking two or three files and separately counting the pixels to find a ratio. One file could have only the images of the book. One file could have only the texts of the book. One file can be completely blank to stand for the 100% part of the ratio. This could combat the fact that most programs when counting pixels would not be able to tell the difference between a word and an image. Maybe I could do this with the advice you have given with the White Pixel percentages. I will definitely experiment with this! Thank you again for the comment. 

Votes

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

Copy link to clipboard

Copied

This was in response to Rob Day's second posted comment: "Looks like it is fairly straight forward to get..." Sorry... I must have clicked the incorrect response button! My head is starting to spin already this Monday morning. 

Votes

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 ,
Jun 05, 2023 Jun 05, 2023

Copy link to clipboard

Copied

Could all the white pixels be counted and compared to all the colored pixels

 

Hi @PensacolaChri30005758izls , I did take your request literally—assuming you really did want to count all white pixels. If you are looking for "white space" as a design aesthetic then obviously the meaning is quite subjective. For text one might define white space literally as I did above, or everthing but the text block (however you want to define that).

 

Via an InDesign script you might temporarily apply an Underline or StrikeThrough to all text, before exporting the PNG to Photoshop for checking the histogram. For example:

 

Screen Shot 7.png

After an Underline script:

Screen Shot 6.png

Or

Screen Shot 9.png

 

The Photshop histogram returns 43% "white space"

 

Screen Shot 10.png

 

Or 59.9%

Screen Shot 8.png

 

 

Votes

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 Beginner ,
Jun 07, 2023 Jun 07, 2023

Copy link to clipboard

Copied

I appreciate your taking the request literally, since objectively pixel counting is the only method I can think of to solve the problem (which is subjective) at hand. Your examples are great, Rob Day! I have been experimenting with other tools and they have all failed so far. The histogram box intrigues me the most. If I can count the different colors of pixels of all the text and all the images and all the blank pages, perhaps I could develop my ratio. (text% / image% / whole page 100%) 

PensacolaChri30005758izls_0-1686147092200.png

 

Votes

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 ,
Jun 07, 2023 Jun 07, 2023

Copy link to clipboard

Copied

The ExtendScript histogram object is an array of 256 numbers, which are the pixel count of each gray level in the image. You can loop through the array and get the pixel counts that are greater than 0. This PNG was exported with anti-aliasing turned off so there are only 4 colors. Get a list of levels with more than 0 pixels:

 

var h = app.activeDocument.histogram;
var s = "Levels with a pixel count greater than 0: \r"
for (var i = 0; i < h.length; i++){
    if (h[i] > 0) {
        s += "Level: " + i + "  " +h[i] + " pixels\r"
    } 
};   
alert(s)

 

Screen Shot 2.png

 

Votes

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

Copy link to clipboard

Copied

https://community.adobe.com/t5/photoshop-ecosystem-discussions/white-vs-colors-vs-black/m-p/13830994

 

Thank you so much for your comment. I am sorry the problem is so confusing - I do not like it either, but it is a problem this analyst has been assigned to resolve. Pixel counting is the only way I can think of (as an adobe novice), but I am grateful for everyone's advice. Of course, the Adobe customer service was no help, so I posted the question everywhere I could think of (see link above). I do appreciate your time. 

Votes

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

Copy link to clipboard

Copied

This comment was in response to Rob Day's first posted comment: "Hi @PensacolaChri30005758izls , InDesign pages are vector objects—th..."

Votes

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 ,
May 31, 2023 May 31, 2023

Copy link to clipboard

Copied

As already mentioned - everything depends on your definition of "white space"... 

Images / vectors - can be checked using Histogram in the Photoshop. 

Text - if you count a letter as a rectangle surrounding the letter - then it can also be calculated. Or raster and count pixels. 

 

But why do you really need this info? Latest EU directive? There was a thread about that few months ago - ended with just counting pixels. 

 

But if you want to count "pixels" - it's not really a solution... because "printed area" depends on the printing technique - you don't have squares on paper - and dots can be cut in half - so you would have to simulate what RIP would create... Then there is DPI / LPI... 

 

Votes

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 ,
May 31, 2023 May 31, 2023

Copy link to clipboard

Copied

As already mentioned - everything depends on your definition of "white space"...

Images / vectors - can be checked using Histogram in the Photoshop.

Text - if you count a letter as a rectangle surrounding the letter - then it can also be calculated.

 

See above. A simple image-area won't properly judge a white background. Histogram won't be too useful unless all the white is BG area. And text is "not white space" from margin to margin, not just in the rectangle of each glyph. Counting space around letters as white space is... nonsensical.

 

It's an esthetic judgment, pure and simple. Trying to automate/measure it raises endless questions that, IMVHO, aren't worth answering. But the answer is "a few hundred for a script will get you the figure you want."


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

Votes

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 ,
May 31, 2023 May 31, 2023

Copy link to clipboard

Copied

I'm not talking about linked image's area - Export As a bitmap and Histogram in Photoshop - with some threshold perhaps. 

 

Text - yes, it's purely esthetic. 

 

But if it's EU directive - anyone have link to it? What exactly are the requirements. 

 

Votes

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 ,
May 31, 2023 May 31, 2023

Copy link to clipboard

Copied

"EU Directive" was just a supposition by Rob. It's the OP's company's wish to know this figure.

 

"White space" is simply not all the white pixels on a page [image]. Nor is it something meaningfully quantifiable; I suggest the goal here is remove any judgment from the evaluation by reducing someting innumerable to numbers. How many millimeters in Mona Lisa's smile?


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.1 ┊ (Amazon) ┊┋

Votes

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 ,
Jun 01, 2023 Jun 01, 2023

Copy link to clipboard

Copied

I've suggested EU directive based on the previous thread - not Rob. 

 

But I agree - counting printed pixels is pointless / misleading. 

 

Votes

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

Copy link to clipboard

Copied

Thank you James Gifford. Yes. Art does not equal Numbers very well... but I am trying to figure it out with the knowledge I have and the resources I have been given. Again, I am glad to have your help with responses in this post. It is nice that someone else understand the impossibilities, but is still willing to give some advice on the matter. 

Votes

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

Copy link to clipboard

Copied

Thank you

Votes

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

Copy link to clipboard

Copied

Thank you for the comment! I appreciate your taking the time to help me in this post. 

Votes

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

Copy link to clipboard

Copied

Thank you for your comment. I will definitely keep it in mind as I research ways to resolve the issue at hand. 

Votes

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