Copy link to clipboard
Copied
I have a TIFF file with dimensions 18320x24440 pixels and a resolution of 508 ppi. The image consists only of black and white pixels, with no gray tones. I would like to create a script that does the following:
- Select all the white areas with a width or height greater than 1x800 pixels.
- Combine these areas into one selection.
- Fill a layer or channel within this selection with black.
Can someone help me with this?
1 Correct answer
Hi,
Save the following in a .psjs file and File > Scripts > Browse...
It should output a selection of the clusters you need. Caveat: it doesn't work on Bitmap, please convert the image to Grayscale first.
const photoshop = require("photoshop");
const { core, imaging, app } = photoshop;
async function getDocumentPixelData(documentID) {
const document = app.activeDocument;
const width = document.width;
const height = document.height;
try {
// Get the pixel data of the document
con
...
Explore related tutorials & articles
Copy link to clipboard
Copied
@Davide_Barranca Can I ask you if you build in some extras in this script?
Copy link to clipboard
Copied
It would be very helpfull if the script starts with dialog screen where it horizontal or vertical, black or white, amount of min or amount of max pixels. It`'s only possible to have one answer per question. Something like attached


-
- 1
- 2