<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On 2-apr-11, at 10:40, aman bansal wrote:</div></div><div><div><br class="Apple-interchange-newline"><blockquote type="cite">i was trying to chalk out a strategy to go for image processing in D.the closest reference i found was in the implementation of python imaging <a href="http://library.it">library.it</a> has modules for imaging,and input output of jpeg and bmp file formats.the data structures used also are quite accurate.i would like to ask developers what can be the possible problems in implementing image i/o in D on the lines of python imaging library.<br clear="all"></blockquote><div><br></div><div>As I told you via email</div><div><br></div><div><div>there are two main things, one is reading/writing several formats, I would say that you should support at least one standard (simple) format natively (the simplest would be netpbm format) but then you could rely on libraries to support more.</div><div>Use of external libraries should be discussed with others also, because one should rely only on libraries that are widely available, cross-platform and with acceptable licensing.</div><div><br></div><div>About the image processing itself you probably want to have a simple flat representation of the image (as 2d array), and then be able to apply several operations on it.</div><div>General convolution is probably something you want to have, masked operation might also be very useful.</div><div>Not sure about which other operations you want to support.</div><div>In D1 as part of blip I have implemented nearest neighbor convolution, it could be useful to you.</div><div><br></div><div>Not sure which bit depth you want to support, one can build a wrapper to access arbitrary bit depth/bitchannel contiguous block of memory as 1d or 2d array (for example 4channel 12 bit images), this can be useful as base type for operations with images that might have an extended bit range.</div></div><div><br></div><div>is this for a GSoC project?</div><div><br></div><div>anyway about Python Image Library, I think that the high level functionality is mostly ok, and probably you can lift some of the C part, but lots seems to be a bit python connection specific, not sure that it is worth using.</div><div>PIL has a BSD style licensing, this might be an issue if you want to have it in phobos (Boost).</div><div><br></div><div>PIL uses the following libraries: </div><div><br></div><div><div>   JPEG support         libjpeg (6a or 6b)</div><div>                        <a href="http://www.ijg.org">http://www.ijg.org</a></div><div>                        <a href="http://www.ijg.org/files/jpegsrc.v6b.tar.gz">http://www.ijg.org/files/jpegsrc.v6b.tar.gz</a></div><div>                        <a href="ftp://ftp.uu.net/graphics/jpeg/">ftp://ftp.uu.net/graphics/jpeg/</a></div><div><br></div><div>   PNG support          zlib (1.2.3 or later is recommended)</div><div>                        <a href="http://www.gzip.org/zlib/">http://www.gzip.org/zlib/</a></div><div><br></div><div>   OpenType/TrueType    freetype2 (2.3.9 or later is recommended)</div><div>   support              </div><div>                        <a href="http://www.freetype.org">http://www.freetype.org</a></div><div>                        <a href="http://freetype.sourceforge.net">http://freetype.sourceforge.net</a>  </div><div><br></div><div>   CMS support          littleCMS (1.1.5 or later is recommended)</div><div>   support              </div><div>                        <a href="http://www.littlecms.com/">http://www.littlecms.com/</a></div></div><div><br></div><div>They seem reasonable, so the first step would be to wrap their C interface (if not already available, like zlib).</div><div>I thought there were some image processing projects in D1, but I haven't found them just now.</div><div>Still also these libraries licensing, and support should be checked, and evaluated also by others.</div><div><br></div><div>Fawzi</div></div></div></body></html>