by the way,
If someone has windows (or wine) here's a demo for CxImage :
This way you can see (by playing with all menu options) what
the library can do... don't forget this is not an actual
application, but it's actually just a "demo" app for the
library... and yeah, it's a pseudo-photoshop! :)
On Tue, Apr 07, 2009 at 12:30:41AM -0400, Youness Alaoui wrote:
> sorry if this is out of thread, I just subscribed to the list (a bit late)
> and found this thread to which I wanted to answer, so I just copy/pasted the
> subject/body and now answering...
> Hi Lukasz,
> Did you have a look at TkCxImage (extension used/written by the aMSN team).
> It's a Tk wrapper around (some portions) of the CxImage library. CxImage is
> a C++ library with zlib licensing.
> You can read all about it here : http://www.xdp.it/cximage.htm
> Look at the formats supported and all the features it supports.. :
> Image formats:
> BMP, ICO, CUR, PCX, TGA, SKA, WBMP,
> GIF, animated GIF
> TIF, multipage TIF
> JPC, JP2, J2K, PGX, PNM, RAS,
> WMF (read only)
> RAW, CRW, NEF, CR2, DNG, ORF, ARW, ERF, 3FR, DCR, X3F, MEF, RAF, MRW, PEF,
> SR2 (read only)
> Contour, Edge, Dilate, Erode
> Median, Noise, Jitter, RedEyeRemove
> Colorize, Gamma, Saturate
> GaussianBlur, TextBlur, SelectiveBlur, UnsharpMask
> Filter, Lut, Gamma, Light, Negative, Dither, Grayscale
> Histogram stretch, equalize, normalize
> Threshold, OptimalThreshold, AdaptiveThreshold
> IncreaseBPP, DecreaseBPP
> Crop, Expand, Thumbnail
> Resample, Rotate, Skew
> Mirror, Flip
> Direct pixel and palette manipulation
> Pixel interpolation
> Colorspaces: RGB, HSL, CMYK, YUV, YIQ, XYZ
> Mix, Combine, Split
> Save animated GIFs and multipage ICONs and TIFs
> Read/Save in memory buffers
> Alpha layer (transparency)
> read/copy EXIF
> automatic file type detection
> Maybe correctly/completely wrap that library would be a good thing.
> Currently aMSN only needs to load/save, thumbnail, resize, and colorize, so
> that's all TkCximage supports for now.
> About animated GIF support, it also automatically does it (well, TkCximage
> does), unfortunately, there are some core changes that would need to be done
> for it to be really good performance wise..
> The real problem with animated gifs is that if you load 100 images, you'll
> end up with 100 timers going off (probably at around 100ms delays each)
> which will do a Tk_PhotoPutBlock and that costs quite a lot CPU time...
> In TkCximage, we used a trick (because of all the users with 100+ animated
> custom smileys being sent/receives in chat) where the timer actually just
> sets which frame should be displayed now and flag the image as 'dirty' and
> as we hook the "Display" method of the PhotoInstance, we actually do the
> Tk_PhotoPutBlock in the Display function if the current frame is different
> from the image in Tk's internal data. This way if no image is displayed (the
> smiley is outside of the viewable area of the text chat (scrolled up)), then
> Tk_PhotoPutBlock is not called (Display is not called).
> Anyways, even with this hack, having about 20 animated smileys and no window
> using any of them (so the image exists but it's never displayed anywhere),
> we end up taking maybe 6% of CPU on my dual core, all because of the timers
> being set off...
> I think a better solution should be found for handling animated GIF (or MNG)
> so whatever you do (TkCximage or some other implementation), if you want to
> add automatic animated GIF support, then you'd have to spend some time
> engineering a good solution for this specific problem!
> If you want to discuss this further, feel free, I'm trying not to flood this
> chat with info you might not want (I have a reputation of writing 100+ KB
> mails :p).
> I'm willing to (partially?) mentor this project if TkCximage is used! I have
> experience with TkCximage and with CxImage, but not much with image
> filter/transformation algorithms.
> By the way, is this GSoC project supposed to provide a Core functionality
> for Tcl 8.6? Or is it about having an extension for doing all this magic
> stuff ? If it's for the core, then I guess Cximage would need to be ported
> to C for that task.. if it's for an extension, leaving CxImage in C++ and
> wrapping it would be totally doable.
> What do you and others think about the TkCximage approach ?
> Jeff Hobbs wrote :
> I would be willing to backup mentor this project (or be primary mentor
> if other projects for which I am primary mentor are not allocated slots).
> I would break this down to focus on grouped areas which will provide
> milestones for development.
> Also, I would deemphasize GIF in favor of PNG (new to core in Tk 8.6)
> and possibly MNG or related openly licensed work.
> On 31/03/2009 3:41 PM, lukas miadowicz wrote:
> > Hello !!
> > I'm very interested in participating in this project. I'm an
> > intermediate in this matter because I have a subject at my University
> > (Technical University of Gdańsk Faculty of Applied Physics) called
> > Graphical Algorithms and Signal Analisys. I had Graphical Algorithms in
> > theory and in practice (implementing this algorithms).
> > First of all, I think it's a vital question :
> > * Who will be the *mentor *of this project (Clif ?) ?
> > Quoting Tomasz :
> > > Image handling enhancements
> > > - Tk Factor Photo Image Handling
> > > - Tk Photo Image Manipulation
> > > - Tk Icon Themes
> > > - [$photo put] support of "" for transparent pixels
> > > - Another thing would be to contribute more image formats (e.g.,
> > > jpeg2000 or MNG) or faster image reader code to tkimg; I'm sure that
> > > would be appreciated, and it could all be done by leveraging other
> > > open code (which mustn't be GPL for license reasons), which is a
> > > Summer-of-Code sort of thing to do.
> > > - Another nice GUI thing would be to add support for automatically
> > > animating a GIF to core Tk. In theory, it should be fairly simple to
> > > do using timer events, though I've no idea about how hard it is in
> > > practice. Right now, the animation has to be done manually, and
> > > without regard for the delays specified in the file.
> > I take all of these into consideration. Thinking that support for other
> > formats is a very good conception.
> > Topic about GIFs is very interesting to me.
> > My propositions of routines for Tk Photo Image Manipulation are :
> > * comparing pictures using image descriptors such as:
> > a) average brightness of a picture
> > b) average contrast of a picture
> > c) variance
> > d) histogram
> > * conversions between color systems e.g. RGB <-> HSV etc. (?)
> > * binarization methods (helpful for document image analysis, OCRs) :
> > a) global thresholding
> > b) p-tile thresholding
> > c) Ridler, Calvard iterative thresholding (1978)
> > d) Otsu method (1979)
> > e) entropy Kapur method
> > f ) thresholding with hysteresis
> > g) White, Rohrer local thresholding method (1983)
> > h) Bernsen method (1986)
> > i) Niblack (1986)
> > j) Sauvola, Pietikainen (2000)
> > * routines for smoothing the picture and noise reduction:
> > a) gaussian filters
> > b) laplace filters (unsharpening the picture)
> > difference is the filters matrixes, adding this filters by convultion.
> > * edge detection routines :
> > a) gradient methods using operators such as:
> > - Roberts operator (1965)
> > - Prewitt operator
> > - Sobel operator
> > - Frei-Chen operator
> > b) Marr - Hildreth algorithm
> > c) Canny algorithm
> > * image compression:
> > a) RLE algorithm
> > b) Huffman algorithm
> > * scalar quantization methods for digital pictures:
> > a) block truncation coding (BTC) with dithering
> > b) Floyd - Steinberg algorithm
> > c) Lloyd - Max Quantization
> > * vector quantization methods for digital pictures:
> > a) Linde-Buza-Gray algorithm (1980)
> > and some others....
> > and the most important (considering Clif's list response) :
> > * Non-integer scaling,
> > * Non-right-angle rotations and including the
> > alpha channel in rotations
> > * Fourier Transforms (I think -> DFT, FFT)
> > Taking some concepts from GIMP or other open-source projects would be a
> > good idea.
> > These are propositions of algorithms that I had on my studies. Many of
> > those I have implemented. These are only propositions and I think that
> > all of those
> > can't be implemented during three months time but some of those are very
> > similar to each other. For example gradients methods which effects on
> > photos are
> > different but algorithms are common (filtering by masks using convultion).
> > I have a lot of theoretical and practical help from my lecturers at my
> > University at Department of Theoretical Physics and Quantum Informatics
> > these are
> > Professor Sergey Leble
> > Ph.D Marcin Wilczewski
> > I'm waiting for response about the mentor...
> > Best regards,
> > Lukas Miądowicz