Category: Photoshop

Per-pixel logic in Photoshop

Issue I have 2 images. I need to create a 3rd image, based on this logic: If the pixel in image 1 and 2 is identical, the pixel in image 3 should be transparent. If the pixel is different between image 1 and 2, use the pixel from image 1. Photoshop blend modes don’t seem […]

Python script simplification

Issue I created this python script to replace images in a psd file, but I feel that I am repeating the same code and was looking to simplify it, since I have more instances of “groups”, I just pasted 2 here to make it shorter. Here is the ps file screenshot. photoshop file screenshot Thank […]

Switch focus/activate another Application after opening it

Issue I added an “Edit with Photoshop” button and succeeded opening Photoshop with a file using this code: Type PhotoshopType = Type.GetTypeFromProgID(“Photoshop.Application”); object PhotoshopInst = Activator.CreateInstance(PhotoshopType); PhotoshopType.InvokeMember(“Open”, BindingFlags.InvokeMethod, null, PhotoshopInst, new object[1] { “c:\files\image.jpg” }); But I am failing to activate (give focus to) Photoshop so the user does not have to switch manually. Any […]

Imitating the “magic wand” photoshop tool in OpenCV

Issue I’m trying to isolate the sky region from a series of grayscale images in OpenCV. All of the images are fairly similar: the top of the image is always a sky region, and is always a bright, gray-white colour. I’ve attempted contour-based approaches, and written my own algorithm to extract the line of the […]

How to make a custom pattern from selection in Photoshop?

Issue TL;DR ‚Äì I want to use code to define a custom pattern from selection in Photoshop using scripting (Extendscript). Here is the code I have so far: (function () { var doc = app.activeDocument; // I put 2 guides in the doc to easily get coords for this test var guides = doc.guides; var […]

Photoshop JavaScript: Delete all guides?

Issue I can only find out a way to remove a single guide from the layout: activeDocument.guides[0].remove(); This targets a single guide using an index. Isn’t there a menu I can call to clear all guides at once? Answer we found from sources You can use activeDocument.guides.removeAll() Answered By ‚Äì Juan Mendes This Answer collected […]

Switch focus/activate another Application after opening it

Issue I added an “Edit with Photoshop” button and succeeded opening Photoshop with a file using this code: Type PhotoshopType = Type.GetTypeFromProgID(“Photoshop.Application”); object PhotoshopInst = Activator.CreateInstance(PhotoshopType); PhotoshopType.InvokeMember(“Open”, BindingFlags.InvokeMethod, null, PhotoshopInst, new object[1] { “c:\files\image.jpg” }); But I am failing to activate (give focus to) Photoshop so the user does not have to switch manually. Any […]