Applescript makes lighter vertical edges on portrait images when converting to black and white

I have an Applescript which takes the images in a folder and converts them to black and white. I have a problem with portrait images. The vertical edges of the images are lighter than the main body of the images. This problem does not happen with any other images e.g. landscape, square.


The script begins with Ask Finder for Items. This is followed by a Get Selected Finder Items. Finally I have a Apply Quartz Composition Filter to Image Files using Black and White as the filter.


Any suggestions as to what I am doing wrong. Thanks

The machine is a Mac Mini running macOS 10.14.3


Mac mini, macOS 10.14

Posted on Mar 6, 2019 7:37 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 6, 2019 1:05 PM

I can reproduce that vertical bar on the image here too. So, in the spirit of plan B, I will show you how to convert those RGB images into Grayscale perceptual without the unwanted vertical bar.


Here is the completed Automator application. The Run Shell Script action simply takes every file fed into it from the previous action, and converts that image in-place using the ColorSync Grayscale profile and perceptual rendering.



The result from your previous posted color image. It may appear larger but in reality is not, as no scaling is occuring in the Automator action.



Similar questions

3 replies
Question marked as Top-ranking reply

Mar 6, 2019 1:05 PM in response to Jaycanyon

I can reproduce that vertical bar on the image here too. So, in the spirit of plan B, I will show you how to convert those RGB images into Grayscale perceptual without the unwanted vertical bar.


Here is the completed Automator application. The Run Shell Script action simply takes every file fed into it from the previous action, and converts that image in-place using the ColorSync Grayscale profile and perceptual rendering.



The result from your previous posted color image. It may appear larger but in reality is not, as no scaling is occuring in the Automator action.



Mar 7, 2019 8:17 AM in response to Jaycanyon

John,


I have spent about an hour testing several portrait-oriented images through the Automator Quartz composer B & W filter. Some of mine receive transparent stripes down the right, and some right and left transparent bands.


I started a "eureka" table of image size, dpi, color space, color profile, alpha, etc. After about ten images, I saw no clear pattern for the transparency artifact, at least, none that I could deduce as causal. Portrait images from my iPhone 4s do not exhibit this behavior, but for instance, an Image that originated in Photoshop CS5 on Windows does, and one that originated from a Fuji finepix camera and later tweaked with other software. I used exiftool and a Python program that I wrote to peer at the image data.


I am uncertain that you will find a definitive reason from fellow users in the support communities for these single and opposite transparency bands on certain portrait images. With respect, I chose not to guess. It could very well be a bug triggered by some abstract image data. Apple engineers do not participate here so we are not going into the Quartz filter internals here either.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Applescript makes lighter vertical edges on portrait images when converting to black and white

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.