Jump to content

Converting Photoshop curve file to Gimp


Recommended Posts

<p>Those links are actually to two different scripts with the same name, the first one written in Perl 5.x, and the second in Python 2.x. Each is just a text file written in one of these programming languages. You need to install the relevant Perl or Python interpreter to run it (neither will generally be pre-installed on Vista). To make sure you are seeing the full names of files with their extensions, first follow these instructions:<br /> http://www.howtohaven.com/system/show-file-extensions-in-windows-explorer.shtml</p>

<p>To be able to run the Perl script, download and install either the latest Activestate community edition, currently 5.24:<br /> http://www.activestate.com/activeperl/downloads<br /> or the equivalent version of Strawberry Perl:<br /> http://strawberryperl.com/<br /> Either will do for this script (the Activestate download is smaller).<br /> <br />To be able to run the Python script, get and install the latest version of Python 2.x (currently 2.7.12):<br /> https://www.python.org/downloads/windows/<br /> Do not download Python 3.x, which may not be compatible. Follow the post-install instructions here for adding Python 2.x to your system PATH so the command prompt knows where to find it:<br /> http://www.howtogeek.com/197947/how-to-install-python-on-windows/</p>

<p>At this point, it will be possible to run the scripts from the Windows command prompt. If you have never used this before, here is a quick guide:<br /> http://www.makeuseof.com/tag/a-beginners-guide-to-the-windows-command-line/</p>

<p>You should read how to use the 'cd' and 'dir' commands to navigate between directories and view the contents.<br /> Put the downloaded script and the curves files you want to process in an appropriate folder (make separate folders for the Perl and Python scripts to avoid confusion), and navigate to that folder. For the Perl script you can then issue a command something like:</p>

<p><strong>perl acv2gimp pscurve.acv >gimpcurve.crv</strong></p>

<p>where acv2gimp is the name of the downloaded Perl script, pscurve.acv is the input curve file in Photoshop format, and gimpcurve.crv is the output file in Gimp format (afterwards move it to Gimp's curves directory).</p>

<p>Similarly for the Python script:</p>

<p><strong>python acv2gimp.py pscurve.acv -o gimpcurve.crv</strong></p>

<p>where acv2gimp.py is the name of the downloaded Python script (if it downloads with the .txt filename extension from the link you gave, first edit the filename of the script so that it is acv2gimp.py, not acv2gimp.py.txt).</p>

Link to comment
Share on other sites

<p>Think I am close, got a parse error message.<br>

The line that the computer accepted was: perl acv2gimp.txt pscurve.acv > gimpcurve.txt.<br>

used the txt for the gimp file, because the GIMP curves I downloaded from the internet that seem to work. had the .txt extension. And, the computer would not recognize the acv2gimp without the .txt.</p>

Link to comment
Share on other sites

<p>Removing the .txt extension applies only to the Python script itself, the one in your second link, which on the web has the name acv2gimp.py.txt, but should be saved or renamed as acv2gimp.py if it is to match the second command line in the example above.<br>

<br />It's probably easier to deal with the Perl and Python scripts separately and get one to work before moving on to the other (if you need to - if one works the other is probably redundant).</p>

<p>What gave you the parse error - the Perl script, the Python script, or GIMP? What was the error?</p>

Link to comment
Share on other sites

<p>I just tested the Perl version with a couple of sample curves ('Brighten' and 'Contrast') from the download on this site:<br>

http://filtergrade.com/free-curves-presets-for-photoshop/</p>

<p>I gave each converted file the .crv extension as in my example perl command line above. GIMP 2.8 on Windows imports them correctly and they have the expected effect when applied. Suggest trying with the same input files to see if they work for you, which will rule out any problems with your setup.</p>

<p>If you still get a parse error when converting these example files, open a converted curve file in a text editor and see if it's in the right format, something like this:</p>

<p># GIMP Curves File<br />0 0 64 55 205 218 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br />0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br />0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br />0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br />0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255</p>

<p>If the converted example curves are OK but yours still doesn't work see if it's in the same format.</p>

 

Link to comment
Share on other sites

<p>If you pad out the file like this in a text editor, using the last 4 lines from the filtergrade examples, does it have the desired effect?:</p>

<p># GIMP Curves File<br />0 0 13 54 25 85 51 120 77 143 102 164 127 180 152 197 178 215 204 230 229 245 242 251 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br>

0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br />0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br />0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br />0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255</p>

Link to comment
Share on other sites

<p>using wordpad:<br /> # GIMP Curves File<br />0 0 13 54 25 85 51 120 77 143 102 164 127 180 152 197 178 215 204 230<br /> 229 245 242 251 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br /> The acv2gimp.txt using note pad is too long lines. while in wordpad, it's a whole page.<br>

(converted albumen curve to gimp)</p>

Link to comment
Share on other sites

<p>the converted contrast.crv file with txt extension:<br>

# GIMP Curves File<br />0 0 64 55 205 218 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br />0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br />0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br />0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br />0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255</p>

Link to comment
Share on other sites

<p>Try installing the Notepad++ editor:</p>

<p>http://notepad-plus-plus.org/</p>

<p>Open the albumen conversion in Notepad++. How many lines? In the bar at the bottom of the window, does it say 'Windows (CR LF)' or something else?</p>

<p>Another test - make a copy of the acv2gimp Perl script and open it in Notepad++. Change the line:</p>

<p>$DEBUG = 0;<br>

<br />to</p>

<p>$DEBUG = 1;</p>

<p>Save the copy and run this modified version of the Perl script on the albumen acv file. Open the output file in Notepad++ and post the contents here.</p>

Link to comment
Share on other sites

<p>From Notepad + +<br>

# GIMP Curves File<br />0 0 13 54 25 85 51 120 77 143 102 164 127 180 152 197 178 215 204 230 229 245 242 251 -1 -1 -1 -1 -1 -1 -1 -1 255 255</p>

<p>At the bottom it does say Windows (CR LF)<br>

Also says 3 lines.<br>

Will do the second test tomorrow</p>

Link to comment
Share on other sites

<p>I would guess this means the file only has one curve, 'Value', and no curves for the RGB channels or Alpha. In Photoshop, does the original .acv file do anything to R,G,B or Alpha?</p>

<p>Try this experiment: In Notepad++, open the albumen conversion and the contrast conversion, copy and paste the last 4 lines from the contrast conversion to the end of the albumen conversion (i.e. after the single line of data), delete any blank lines (i.e., leave no gaps between lines), and save it to a new file, i.e.:</p>

<p># GIMP Curves File<br />0 0 13 54 25 85 51 120 77 143 102 164 127 180 152 197 178 215 204 230 229 245 242 251 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br /> 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br />0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br />0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255<br />0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255</p>

<p>Load into GIMP and see if it does what you expect. My guess is that these last 4 lines are 'neutral', but GIMP still needs them to be there to parse the converted file correctly (perhaps Photoshop doesn't care if an acv file contains no RGB or Alpha data, assuming the albumen acv file works correctly in PS).</p>

Link to comment
Share on other sites

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
×
×
  • Create New...