<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>code-diesel &#187; photoshop</title>
	<atom:link href="http://www.codediesel.com/tag/photoshop/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codediesel.com</link>
	<description>/* PHP &#38; MySQL Journal */</description>
	<lastBuildDate>Thu, 02 Feb 2012 13:19:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Transferring large PSD files quickly using Diff-Patch</title>
		<link>http://www.codediesel.com/tools/transferring-psd-files-quickly/</link>
		<comments>http://www.codediesel.com/tools/transferring-psd-files-quickly/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 04:32:35 +0000</pubDate>
		<dc:creator>sameer</dc:creator>
				<category><![CDATA[tools]]></category>
		<category><![CDATA[photoshop]]></category>

		<guid isPermaLink="false">http://www.codediesel.com/?p=470</guid>
		<description><![CDATA[Recently for a small design work a creation of a Photoshop PSD document was required. Being a high resolution image the file size went up to something around 85MB. Zipping the document brought down the size to a manageable 35MB (but still quite large for my net connection) . As all designers know, frequent modifications [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-501" title="psd1" src="http://www.codediesel.com/wp-content/uploads/2009/03/psd1.jpg" alt="psd1" width="77" height="77" />Recently for a small design work a creation of a Photoshop PSD document was required. Being a high resolution image the file size went up to something around 85MB. Zipping the document brought down the size to a manageable 35MB (but still quite large for my net connection) . As all designers know, frequent modifications are a part of the process, and I surely needed to do one on the original PSD; which meant I had to send the whole modified PSD file again to the client, even though the actual modifications were quite minor. As I use a 384Kbps broadband line, it takes quite a while to upload the file. Make a couple of more revisions and you can see how much precious  time is wasted in transferring the document. As I&#8217;m not a designer by profession, I&#8217;m unaware of any tools that might ease this process. So I thought if using a binary diff and patch utility would help me make my job easier.<br />
<span id="more-470"></span></p>
<p><strong>Diff and Patch</strong><br />
A binary diff program is a file comparison utility that outputs the differences between two binary files. The output is called a &#8216;patch&#8217; which can then be applied to the original file to get the modified version of the file. Basically what I wanted to do was send only the difference (patch) between the original PSD and the modified PSD to the client, wherein the client would reconstruct the modified PSD from the original (which I had already sent him)  and the patch file.</p>
<p><strong>Downloading the Diff utility</strong><br />
I downloaded the <a title="jojodiff" href="http://sourceforge.net/projects/jojodiff/" target="_blank">jojoDiff</a> utility and tried to see if it might help me to get the difference of two PSD files.To my surprise it worked. The patch for the 85MB PSD came to only 2MB. After trying some combination&#8217;s on various PSD files to see the accuracy and speed of the diff utility, I decided to send the client the patch program (with a Windows batch file to automate the process) and the patch file itself, saving us both quite a huge amount of time.</p>
<p><strong>How all this works</strong><br />
The jojoDiff package contains two programs <em>jdiff-w32.exe</em> and <em>jpatch-w32.exe</em>, the first one gets the difference of two binary files outputting a patch file, and the second combines the patch file with the original to give us the second file. My original PSD and the revision were named <em>work_0.psd</em> and <em>work_1.psd</em> respectively. The <em>work_0.psd</em> file size came to 85MB and the <em>work_1.psd</em> file size to 156MB. To get the difference between the two PSD&#8217;s you need to run jdiff-w32 from the command prompt as follows.</p>

<div class="wp_codebox"><table><tr id="p4703"><td class="code" id="p470code3"><pre class="dos" style="font-family:monospace;">jdiff-w32  work_0.psd  work_1.psd  patch.p</pre></td></tr></table></div>

<p>This will output a <em>patch.p</em> file in the same directory, which in my case came to a size of 2MB. Now you only need to send the <em>patch.p</em> file (instead of the modified file) to the client.  To reconstruct the <em>work_1.psd</em> from the patch file and the original <em>work_0.psd</em> enter the following command.</p>

<div class="wp_codebox"><table><tr id="p4704"><td class="code" id="p470code4"><pre class="dos" style="font-family:monospace;">jpatch-w32  work_0.psd  patch.p  work_1.psd</pre></td></tr></table></div>

<p>This will create the modified <em>work_1.psd</em> file.</p>
<p>The program may take anywhere from seconds to minutes depending on the complexity of the PSD design and file sizes.  You can send as many patch&#8217;s to the client as the number of revisions you make to the original PSD. The advantage besides the file size is that the client can construct any revised PSD from the original and the particular patch file sent.</p>
<p>Below is shown a flowchart of the whole process along with the file sizes I encountered in my work.</p>
<p><img class="aligncenter size-full wp-image-480" title="diffpatch" src="http://www.codediesel.com/wp-content/uploads/2009/03/diffpatch.gif" alt="diffpatch" width="470" height="498" /></p>
<p><strong>Conclusion</strong><br />
This process has worked wonderfully for me. I&#8217;ve tried this method on a dozen or more PSD&#8217;s to check the accuracy of the output to good results; although I&#8217;ve not used this on other image types. Many times when the PSD files sizes are small the patch file can get larger than the original, its really useful when the PSD&#8217;s are large. To ensure correctness it is also better to send to the client a low resolution GIF image of the modified PSD along with the patch file.</p>
<p>I request the readers who try this method to let me know the accuracy and speed of the process.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codediesel.com/tools/transferring-psd-files-quickly/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

