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.
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.
Zyarareaa2
Posts: 1
Joined: Wed Apr 29, 2026 6:45 am
Location: https://melonplaygroundgame.org/

Re: Compare pixels

Post by Zyarareaa2 »

Saskia_Casper wrote: Thu Apr 16, 2026 12:43 pm 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.
even a correctly written script can behave unpredictably if there are hidden factors in the file—such as layer properties, blending modes, metadata, or color profiles—that the scripting engine doesn’t fully expose or interpret consistently. These subtle differences can lead to incorrect layer targeting or unexpected results.