Total pixels in the Image

Explorer ,
Jul 09, 2019

Copy link to clipboard

Copied

Hi,

Is there a way to know the total number of pixels in an image (i.e. multiplying the dimensions of the image (height and width)).

A software or a Script would be helpful which can tell me the total pixels in the image, and if the pixels are exceeding above the specific 4 million pixels its should get highlight or given us an error message.

Please help me with the same.

Regards

Arvind

TOPICS
Scripting

Views

232

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

Total pixels in the Image

Explorer ,
Jul 09, 2019

Copy link to clipboard

Copied

Hi,

Is there a way to know the total number of pixels in an image (i.e. multiplying the dimensions of the image (height and width)).

A software or a Script would be helpful which can tell me the total pixels in the image, and if the pixels are exceeding above the specific 4 million pixels its should get highlight or given us an error message.

Please help me with the same.

Regards

Arvind

TOPICS
Scripting

Views

233

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
Jul 09, 2019 0
Enthusiast ,
Jul 09, 2019

Copy link to clipboard

Copied

If you are on a Mac, with AppleScript you have the Image Events application that gives you the following for an image contained in a file:

file type, bit depth, color space, dimensions (the width and height, in pixels), embedded profile - the profile if any

image file - a reference to the file that contains the image

location - the folder or disk that contains the file

name - name of the image

resolution - horizontal and vertical pixel density of the image, in dots per inch

Example:

set theFile to choose file

tell application "Image Events"

set thisImage to open theFile

set theDim to dimensions of thisImage

set totSize to (item 1 of theDim) * (item 2 of theDim)

close thisImage

end tell

totSize

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
Reply
Loading...
Jul 09, 2019 2
Explorer ,
Jul 09, 2019

Copy link to clipboard

Copied

Thanks for the reply Hopkins

Unfortunately I don't have MAC, is there a way where we can check the above mentioned in Windows PC.

Or any Preflight in Indesign or Adobe Acrobat.

Regards

Arvind

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
Reply
Loading...
Jul 09, 2019 0
Enthusiast ,
Jul 10, 2019

Copy link to clipboard

Copied

I'm sure there is some way on the PC. Best I could do would be to script Photoshop. Maybe someone else has a better solution.

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
Reply
Loading...
Jul 10, 2019 0
Explorer ,
Jul 10, 2019

Copy link to clipboard

Copied

If possible can you please help me with the script Photoshop.

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
Reply
Loading...
Jul 10, 2019 0
Most Valuable Participant ,
Jul 11, 2019

Copy link to clipboard

Copied

Photoshop has a Scripting Forum of its own: Photoshop Scripting

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
Reply
Loading...
Jul 11, 2019 0
Explorer ,
Jul 11, 2019

Copy link to clipboard

Copied

Thanks for the reply.

An script in Indesign will also do.

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
Reply
Loading...
Jul 11, 2019 0