skip to Main Content

I want to automatically manipulate images with ImageMagick (or any other tool that can be run on an Ubuntu server or called via an API). In order to get exactly the result I want, I have tinkered with Photoshop and exported the XMP metadata to document the manipulation. It looks like this:

<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.3-c007 1.136881, 2010/06/10-18:11:35        ">
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about=""
    xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/"
   crs:Version="7.0"
   crs:ProcessVersion="6.7"
   crs:Sharpness="38"
   crs:LuminanceSmoothing="0"
   crs:VignetteAmount="-17"
   crs:VignetteMidpoint="32"
   crs:SplitToningShadowHue="0"
   crs:SplitToningShadowSaturation="0"
   crs:SplitToningHighlightHue="0"
   crs:SplitToningHighlightSaturation="0"
   crs:SplitToningBalance="-15"
   crs:ParametricShadows="-14"
   crs:ParametricDarks="-16"
   crs:ParametricLights="+4"
   crs:ParametricHighlights="+31"
   crs:ParametricShadowSplit="25"
   crs:ParametricMidtoneSplit="50"
   crs:ParametricHighlightSplit="75"
   crs:SharpenRadius="+0.5"
   crs:SharpenDetail="100"
   crs:SharpenEdgeMasking="17"
   crs:PostCropVignetteAmount="0"
   crs:GrainAmount="24"
   crs:GrainSize="2"
   crs:GrainFrequency="6"
   crs:LensProfileEnable="0"
   crs:LensManualDistortionAmount="-2"
   crs:PerspectiveVertical="0"
   crs:PerspectiveHorizontal="0"
   crs:PerspectiveRotate="0.0"
   crs:PerspectiveScale="100"
   crs:Exposure2012="-0.05"
   crs:Contrast2012="0"
   crs:Highlights2012="+27"
   crs:Shadows2012="+18"
   crs:Whites2012="+29"
   crs:Blacks2012="+1"
   crs:Clarity2012="+6"
   crs:ToneCurveName2012="Linear"
   crs:LensProfileSetup="Auto"
   crs:HasSettings="True">
   <crs:ToneCurvePV2012>
    <rdf:Seq>
     <rdf:li>0, 0</rdf:li>
     <rdf:li>255, 255</rdf:li>
    </rdf:Seq>
   </crs:ToneCurvePV2012>
   <crs:ToneCurvePV2012Red>
    <rdf:Seq>
     <rdf:li>0, 0</rdf:li>
     <rdf:li>255, 255</rdf:li>
    </rdf:Seq>
   </crs:ToneCurvePV2012Red>
   <crs:ToneCurvePV2012Green>
    <rdf:Seq>
     <rdf:li>0, 0</rdf:li>
     <rdf:li>255, 255</rdf:li>
    </rdf:Seq>
   </crs:ToneCurvePV2012Green>
   <crs:ToneCurvePV2012Blue>
    <rdf:Seq>
     <rdf:li>0, 0</rdf:li>
     <rdf:li>255, 255</rdf:li>
    </rdf:Seq>
   </crs:ToneCurvePV2012Blue>
  </rdf:Description>
 </rdf:RDF>
</x:xmpmeta>

Now I would like to apply exactly the same manipulation with a tool that can be run server-side. Is it possible ? Can I achieve exactly the same result with ImageMagick ? Does Photoshop expose an API, or maybe a SDK allowing me to do that ?

2

Answers


  1. I think it would be a pretty massive ask of ImageMagick to achieve identical results, or even close, to those achieved by Photoshop.

    Adobe puts massive development effort into ACR (Camera Raw) and things like lens profiles require vast amounts of testing and management of databases of lens characteristics on different cameras which are just not part of the remit or objective of ImageMagick.

    Also, ImageMagick delegates the RAW processing to UFRAW and I don’t believe that supports advanced features like “Clarity” and “Luminance Smoothing”.

    Photoshop does expose an API which is scriptable – Adobe Photoshop Scripting in JavaScript, AppleScript and VBScript.

    Login or Signup to reply.
  2. One way to accomplish this for RAW photos is to use the free Adobe DNG Converter (available for both Windows and macOS, but the Windows version might run with wine).

    When you ask it to convert a RAW to a DNG you can have it embed a full size JPEG preview in the DNG. It will respect whatever settings are in the XMP when generating the JPEG preview. You can ask it to convert a DNG to a second DNG as a way to update the embed preview. And it works from the command line.

    Then use something like ExifTool to edit the XMP metadata, and to extract the embed JPEG preview.

    I’ve used this with reasonable success to create a barebones RAW converter:
    https://github.com/ncruces/RethinkRAW

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search