[ANN] Smagick

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[ANN] Smagick

Hi all,

"Smagick" is a small high level interface to control "Image Magick"  
from within a Smalltalk environment, eg. Squeak. The purpose of this  
package is to provide high performance image manipulations without  
the need to know all the low level details of image processing.

A possible use case could be a web application providing image up/
download or even manipulation (for example thumbnailing, resizing,  
recompression) to multiple users ...

What can "Smagick" do right now:
  - it can read all internal image properties  (examples: width,  
height, colorspace, encoder, quality, bounding-box, ......)
  - it can read most exif information  (examples: camera software,  
date, orientation, shutter-speed, .....)
  - it can convert any image format* to any other format*
  - it can apply various image transformations concerning quality,  
colors, effects, orientation, size, metas (examples: resize,  
charcoal, emboss, colorspace, exif-auto-orientation, .....)
  - it can compose [work in progress] multiple images (examples:  
multiply, difference, add, ......)

* depends on your "Image Magick" installation

I attached some more information about getting, installing and using  
"Smagick" at the bottom of this mail ...

I will add more features and try to make the interface more simple  
and robust ... in the meantime I'm looking forward to some feedback



GETTING "Smagick"

"Smagick" depends on
  - OSProcess (+ UnixVM)

You can get "Smagick" from
  - "http://www.squeaksource.com/SqueakAddOns"
It will load all dependencies (except OSProcess)



If you have "OmniBrowser" installed, execute the following after  
loading "Smagick"
    SmagickEnvironment setup
This will ask you for the installation path of "Image Magick",  
providing an example of how this could look like ;). Furthermore it  
will check whether "Image Magick" really exists in the given location.

If you don't have Omnibrowser installed, use
    SmagickEnvironment setupSilent: 'your installation path'
This will set the path but not perform a check.



" this will apply some transformations on aFile.JPG and then save it  
to anotherFile.PNG "
" NOTICE: the order of transformations is relevant !!! "
(SmagickImage on: 'aFile.jpg')
   convertTo: 'anotherFile.png'
   with: [ :image | image
     sharpen: 20;
     colors: 256;
     quality: 20 ]

" this will negate the cyan color channel only and then save  
aFile.JPG to anotherFile.PNG "
(SmagickImage on: 'aFile.jpg')
   convertTo: 'anotherFile.png'
   with: [ :image | image
       with: SmagickConstants cyan
       do: [ :channel |
         channel negate ] ]

" get the compression ratio of aFile.JPG "
(SmagickImage on: 'aFile.jpg')
   compressionQuality inspect
Announcements and News from the Squeak Community
Squeak: http://squeak.org/
[hidden email]