Compare pixels

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

Sablerock
Posts: 1
Joined: Thu Mar 02, 2023 4:54 am

Compare pixels

Post by Sablerock »

Guys
I need to compare 2 png images A and B. Identical number of pixels. If pixel(x,y) from A is lighter(whiter) than B, then move A to B.
I did search the board, nothing came up.
Is there a script for this?
Many thanks

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

User avatar
Kukurykus
Posts: 531
Joined: Mon Jul 25, 2016 12:36 pm

Re: Compare pixels

Post by Kukurykus »

Upload examplary files to compare.
User avatar
Stephen_A_Marsh
Posts: 38
Joined: Sun Aug 04, 2019 12:37 pm

Re: Compare pixels

Post by Stephen_A_Marsh »

Layer the file that may have lighter pixels over the other file (2 layers). In the upper layer file, set the blend mode to lighten. Merge or flatten the layers.
Garysmith
Posts: 2
Joined: Thu Apr 02, 2026 4:05 am

Re: Compare pixels

Post by Garysmith »

The article demonstrates meticulous effort in both its content and presentation, offering an excellent reading experience. The information is useful, accessible, and highly practical. It is a valuable resource for anyone seeking knowledge related to this subject. papa's scooperia
Saskia_Casper
Posts: 1
Joined: Thu Apr 16, 2026 12:39 pm

Re: Compare pixels

Post by Saskia_Casper »

That sounds like a tricky scripting challenge. When you're dealing with specific layer adjustments or blending modes in Photoshop via script, it’s often those small differences in DOM versions that cause the unexpected behavior.
If you’re still seeing inconsistencies with how the layers are being targeted, it might be worth running a quick check on the layer properties or the file structure itself before the script executes. I’ve found that using a dedicated metadata or file info utility can sometimes catch hidden layer attributes or color profile issues that the script engine doesn't always report clearly. Checking the file integrity first often saves a lot of time debugging the actual code.