{"id":462,"date":"2016-01-31T23:53:29","date_gmt":"2016-01-31T23:53:29","guid":{"rendered":"http:\/\/blog.paranoidprofessor.com\/?p=462"},"modified":"2016-01-31T23:53:59","modified_gmt":"2016-01-31T23:53:59","slug":"the-joy-of-non-standard-graphic-formats","status":"publish","type":"post","link":"https:\/\/blog.paranoidprofessor.com\/index.php\/2016\/01\/31\/the-joy-of-non-standard-graphic-formats\/","title":{"rendered":"the joy of non-standard graphic formats"},"content":{"rendered":"<p>It was a wild and carefree time in the nineties.\u00a0 Partying with friends, going on vacations, as well as traveling to exotic locations.\u00a0 Some of my friends had not only gone on vacations but they had Kodak create some CD&#8217;s with their holiday photos. It was pretty cool at that time so I went out and did that as well for some of my photos.<\/p>\n<p>Fast forward to today.\u00a0 For the most part nobody gets their film developed nor converted to photo CD&#8217;s, we simply copy them from the camera to our computer and cut out some of those obsolete steps.<\/p>\n<p>While going through my desk drawers I found some of these old photo CD&#8217;s. It was only at this point that I realized that the solution at that time was fine but none of my current programs can deal with this proprietary PCD as a photo format.<\/p>\n<p>This format, although proprietary, can be manipulated by a number of different programs.\u00a0 Some of the choices available such as Irfanview for Windows or iPhoto for the Macintosh.\u00a0 This is not the limit of available choices just a few of those that can be purchased.\u00a0 I didn&#8217;t want to purchase a piece of software to convert seven CD&#8217;s never to be used again.<\/p>\n<p>Yet, I was lucky enough to find some source code which can only convert from PCD to JPEG but that was exactly the conversion that I was looking for.<\/p>\n<p><strong>PCDTOJPEG<\/strong><\/p>\n<p>The utility, pcdtojpeg, is a command line program which is distributed as three source files.<\/p>\n<p>Simply get the latest source at <a href=\"http:\/\/sourceforge.net\/projects\/pcdtojpeg\/files\/latest\/download\" target=\"_blank\">http:\/\/sourceforge.net\/projects\/pcdtojpeg\/files\/latest\/download<\/a>.<\/p>\n<p>I didn&#8217;t compile this on Windows or for the Macintosh, just on Linux.\u00a0 Unlike a lot of Linux projects there was no makefile nor complicated shell scripts.\u00a0 Just a single command will compile both source files into the binary.<\/p>\n<div class=\"sbody-code\">\n<pre><code>&gt; g++ main.cpp pcdDecode.cpp -ljpeg -lpthread -o pcdtojpeg\r\n&gt; chmod 777 pcdtojpeg\r\n&gt; .\/pcdtojpeg\r\n\r\npcdtojpeg, version 1.0.12 \r\nCopyright (C) 2009-2015 Sandy McGuffog\r\nJPEG compression code Copyright (C) 1991-1998, Thomas G. Lane.\r\n\r\nUsage:\u00a0 .\/pcdtojpeg [options] file1 [file2]\r\n\r\nValid options:\r\n-h\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Print this message\r\n-v\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Verbose file information\r\n-m\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Process the file as monochrome\r\n-D50\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Process for a white balance of D50\r\n-D65\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Process for a white balance of D65 &lt;default&gt;\r\n-q nnn\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 JPEG file quality (nnn range 1 to 100 &lt;100&gt;)\r\n-b n.n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Brightness adjustment (n.n range -2.0 to 2.0 &lt;0.0&gt;)\r\n-r n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Highest resolution to extract (n range 0 to 5):\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0 - Base\/16 (128 x 192)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1 - Base\/4 (256 x 384)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2 - Base (512 x 768)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3 - 4Base (1024 x 1536)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;4 - 16Base (2048 x 3072)&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 5 - 64Base (4096 x 6144)\r\n<\/code><\/pre>\n<\/div>\n<p>I actually relish the command line, so using this utility was perfect.\u00a0 To use this program, I created a small shell script which takes all PCD files from the current directory and converts them to JPEG.<\/p>\n<div class=\"sbody-code\">\n<pre><code>#!\/bin\/bash\r\nconvert()\r\n{\r\n   .\/pcdtojpeg -q 100 -r 4 $1 ${1}-4.jpeg\u00a0 &amp;\r\n}\r\n\r\nLIST=`ls -1 *.pcd` \r\n\r\nfor i in $LIST\r\ndo\r\n   convert $i\r\ndone\r\n<\/code><\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>It was a wild and carefree time in the nineties.\u00a0 Partying with friends, going on vacations, as well as traveling to exotic locations.\u00a0 Some of my friends had not only gone on vacations but they had Kodak create some CD&#8217;s &hellip; <a href=\"https:\/\/blog.paranoidprofessor.com\/index.php\/2016\/01\/31\/the-joy-of-non-standard-graphic-formats\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,3],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/462"}],"collection":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/comments?post=462"}],"version-history":[{"count":10,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/462\/revisions"}],"predecessor-version":[{"id":649,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/462\/revisions\/649"}],"wp:attachment":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/media?parent=462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/categories?post=462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/tags?post=462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}