Skip to main content
PensacolaChri30005758izls
Known Participant
May 30, 2023
Question

White Space vs Pictures vs Words

  • May 30, 2023
  • 4 replies
  • 2114 views

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?

This topic has been closed for replies.

4 replies

Peter Spier
Community Expert
Community Expert
June 7, 2023

Just going to weigh in that I think counting white pixels in not what most people would consider "white space" in a design. I would say the traditional unerstanding is white space encompasses "blank" areas outside any image areas and type-filled zones and would not include counters in glyphs or white pixels in an image or the leading space in a block of text.

PensacolaChri30005758izls
Known Participant
June 28, 2023

Thank you! I will keep this in mind as I analyze these pages. 

Robert at ID-Tasker
Legend
May 31, 2023

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

 

James Gifford—NitroPress
Legend
May 31, 2023

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

Robert at ID-Tasker
Legend
May 31, 2023

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. 

 

rob day
Community Expert
Community Expert
May 31, 2023

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.

rob day
Community Expert
Community Expert
May 31, 2023

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:

 

 

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:

 

James Gifford—NitroPress
Legend
May 31, 2023

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.

James Gifford—NitroPress
Legend
May 30, 2023

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. 

PensacolaChri30005758izls
Known Participant
May 31, 2023

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

James Gifford—NitroPress
Legend
May 31, 2023

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.