Page 1 of 2

Adjustments > black and white > preset feature

Posted: 2018-07-26T04:46:25-07:00
by mjamal
Hello Team,

Can anyone provide the details if the below photoshop options are available in PHP iMagick library?

1. image > adjustments > black and white > preset = infrared
2. image > adjustments > black and white > preset = maximum black

Ie I need to implement the above two options for the the image in PHP application.

Let me know if this is possible via iMagick or image magick.

Thanks
Mohtashim Jamal

Re: Adjustments > black and white > preset feature

Posted: 2018-07-26T08:41:31-07:00
by fmw42
There are no direct equivalents in ImageMagick (thus not in Imagick) for these outputs. But you should be able to figure out the transformations and find the proper ImageMagick commands to combine to make the equivalent. In ImageMagick, you could create a 3D HALD image as PNG. Take it to Photoshop. Process the hald image to make the effect you want. Then bring the HALD image back to ImageMagick and use -hald-clut command to process any image to do the same. See https://www.imagemagick.org/Usage/color_mods/#hald-clut. In Imagick, see http://us3.php.net/manual/en/imagick.haldclutimage.php

Re: Adjustments > black and white > preset feature

Posted: 2018-07-30T22:50:19-07:00
by mjamal
Hello Fred,

With using the HALD image, I can manage the PS Image black and White features as requested.

Thank you for your suggestion.

Re: Adjustments > black and white > preset feature

Posted: 2019-01-08T03:14:55-07:00
by mjamal
Hi Team,

My mentioned effects were working with the HALD image at the ImageMagick version 6.7 but when we have upgraded the ImageMagick version to 7.0.8 then suddenly the HALD image as per the suggestion is stopped working.

I have checked with IM command as well as Imagick commands but for both the it is not giving result same as photoshop.
Below is the input and HALD image and script & PS results.

Used the below commands for results.

IM Command:
exec("convert uploads/CloneOutput20190108040033.png hald-infrared.png -hald-clut checkIRCMD.png");

Imagick Command:
$duplicateImage = new \Imagick(realpath("CloneOutput20190108040033.png"));
$imagickPalette = new \Imagick(realpath("hald-infrared.png"));
$duplicateImage->haldClutImage($imagickPalette,Imagick::CHANNEL_DEFAULT);
$duplicateImage->writeImage("checkIR.png");

NOTE: Ihave checked black and white > preset > Infrared and also need the same for Maximum Black.

Hald Image: https://www.dropbox.com/s/yfvwxrldq0t4h ... d.png?dl=0
Input Image: https://www.dropbox.com/s/zd8zuz4uvbbwq ... 3.png?dl=0
Script Output: https://www.dropbox.com/s/m5ra9y900hbut ... D.png?dl=0
Photoshop Output: https://www.dropbox.com/s/ltxbwzjaq027k ... T.png?dl=0

Please provide your feedback on this.

Re: Adjustments > black and white > preset feature

Posted: 2019-01-08T05:45:12-07:00
by snibgo
V7 has some differences to v6. See http://www.imagemagick.org/script/porting.php . By default, v6 operations don't include the alpha channel. By default, v7 operations do.

For your command, insert "-channel RGB" before "-hald-clut" and "+channel" after.

Re: Adjustments > black and white > preset feature

Posted: 2019-01-08T23:35:55-07:00
by mjamal
Hello Snibgo,

My issue has been resolved with the fix you mentioned. Thank you!

Re: Adjustments > black and white > preset feature

Posted: 2019-01-09T04:16:15-07:00
by mjamal
Hello Snibgo,

I have one issue with the below command, ie the input image is showing Channel as RGB in photoshop and output from the below command is showing Channel as Gary in photoshop. You can see screen from URL https://www.screencast.com/t/1hxsmukgAQL.
Kindly let me know how we can fix this issue?

exec("convert CloneOutput20190108040033.png hald-infrared.png -channel RGB -hald-clut +channel checkIRCMD.png");

Re: Adjustments > black and white > preset feature

Posted: 2019-01-09T04:31:59-07:00
by snibgo
The result has only grayscale pixels, so IM by default stores only one channel in the PNG file. If you want 3 channels, use the "PNG24:" prefix, eg:

Code: Select all

convert CloneOutput20190108040033.png hald-infrared.png -hald-clut PNG24:x.png

Re: Adjustments > black and white > preset feature

Posted: 2019-01-11T02:24:23-07:00
by mjamal
Hello Snibgo,

I have checked with adding "PNG24:" but it again starts giving me the bad result for my image and now I am getting output as given in below URL.
https://www.dropbox.com/s/m5ra9y900hbut ... D.png?dl=0

I have ran the below two commands but getting same result as mentioned in above URL.
exec("convert CloneOutput20190108040033.png hald-infrared.png -channel RGB -hald-clut +channel PNG24:2x.png");
And
exec("convert CloneOutput20190108040033.png hald-infrared.png -hald-clut PNG24:4x.png");

Re: Adjustments > black and white > preset feature

Posted: 2019-01-11T06:50:37-07:00
by snibgo
What version of IM are you using? For v7, I suggest you use "magick", not "convert". For both v6.9.9-50 and v7.0.7-28, PNG24: gives me a png with three 8-bit channels.

Re: Adjustments > black and white > preset feature

Posted: 2019-01-13T22:54:04-07:00
by mjamal
Hi Snibgo,

I am using IM 7.0.8 version at the CentOS server.
Using the below command but still getting the issue with background is not as expected. Please suggest.

exec("magick CloneOutput20190108040033.png hald-infrared.png -channel RGB -hald-clut +channel PNG24:5x.png");

Re: Adjustments > black and white > preset feature

Posted: 2019-01-20T21:42:05-07:00
by mjamal
Hello Team,

It will be good if any one please provide any suggestion on my above query.

Re: Adjustments > black and white > preset feature

Posted: 2019-01-21T10:47:35-07:00
by fmw42
You post an input image with transparency replaced by a checkerboard. If your input image has transparency, then post that image with actual transparency.

Re: Adjustments > black and white > preset feature

Posted: 2019-01-21T22:32:05-07:00
by mjamal
Hi Fred,

I have sent you the input images via email, please check and let me know if its fine with you.

Re: Adjustments > black and white > preset feature

Posted: 2019-01-22T13:20:16-07:00
by fmw42
Please post your images here so others, too, can help solve your problem.