Jump to content

Recommended Posts

Posted

Hello everyone, 
I have been looking for the following and haven't find the answer yet. 

I have a folder where there is .bmp images in RGB, and I need to convert all the images in that folder to CMYK. Then all those files I'll need to export(save) them to .TIFF format.

Thank you for any help you can provide. I'll appreciate any script example you can share. 

Posted (edited)

Yes, ImageMagick would do the trick, though COM is broken in newer autoit's, you'll have to revert back to 3.3.12 or 3.3.10 to be sure all of it works.

Like this works in 3.3.12 but not in later versions

For $Loop = 0 To 8

$img.Convert("-size","1024x1024","xc:", "-seed",String(9669 + $Loop), "+noise","Random", "-write", "mpr:random","+delete", _
             "mpr:random","-channel","r","-threshold",String(GUICtrlRead($VegDensityGUI[$Loop])/10) & "%","-separate","+channel","-negate","-fill",$VegColor[$Loop],"-opaque","white","-write","mpr:" & $VegName[$Loop],"+delete", _
             "./Media/Textures/heightmap.png", "-write","mpr:heightmap", "-threshold","35%", "-write","mpr:low","+delete", _
             "mpr:heightmap","-threshold","55%","mpr:low","-compose","Difference","-composite","-write","mpr:treemap","+delete", _
             "mpr:" & $VegName[$Loop], "mpr:treemap", "-compose","Multiply", "-composite", "-flop", "-write","mpr:treemap", "+delete", _
             "mpr:treemap", "-morphology" ,"hmt","5:0,0,0,0,0 0,0,0,0,0 0,0,1,0,0 0,0,0,0,0 0,0,0,0,0","./Media/Models/Trees/" & $VegName[$Loop] & "Map.png")
Next

 

Edited by Werty

Some guy's script + some other guy's script = my script!

Posted

Well, you can always ShellExecute.

$ImageMagickExePath = "C:\Program Files\ImageMagick-6.9.3-Q16\convert.exe"
$ImageToReadPath = @ScriptDir & "\message.jpg"
$ImageToReadPathResult = @ScriptDir & "\message_result.jpg"

ShellExecuteWait($ImageMagickExePath, '"' & $ImageToReadPath & '" -fuzz ' & $Percentage & '% -fill black +opaque "#' & $Coloer & '" -threshold 20% -negate "' & $ImageToReadPathResult & '"', "", "", @SW_HIDE)

 

Posted

Dear @Werty and @Seminko, 
Thank you very much for the response. The link to ImageMagick actually help me to complete the task. I download some cmyk profiles and ran the command:

convert cmyk_image.jpg -colorspace rgb rgb_image.jpg

Now I have to execute that from my autoit script. 

 

Thanks for your help. 

Posted

On a side note, when manipulating images, use a lossless format like png or bmp, if you use jpg it will degrade the image even further for each step, compressing an already compressed image.

Some guy's script + some other guy's script = my script!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...