Gnocl Cookbook‎ > ‎

ImageMagic - Deskewing and other Image Manipulation Operations

The basic gnocl::pixbuf widget allows for the creation and maniputlation of imagery for use within applications such as icons, banners, and panels. It also has support for Cairo drawing operations plus some simple manipulations such contrast and posterization.

However, perhaps specific user applications may require more sophisticated image manipulation tools. These can be obtained on the Tcl side by using the exec command to run background applications, most notably ImageMagick. The following script example shows how a file can be deskewed, imported into a pixbuf, modified and displayed as an image.

proc pkg::deskew {} {

    eval exec "convert \
       -background white \
       -rotate -10 \
   
    -deskew 40% \
      
./deskew.png ./deskew-not.png"

    gnocl::window -child [gnocl::image -image %/
./deskew-not.png] -title [info level 0]
}

The following alternative command options are available for the ImageMagic convert command line operations (15/12/19):

‑adaptive‑blur‑adaptive‑resize‑adaptive‑sharpen‑adjoin‑affine‑alpha‑annotate‑antialias‑append‑attenuate‑authenticate‑auto‑gamma‑auto‑level‑auto‑orient‑auto‑threshold‑backdrop‑background‑bench‑bias‑black‑point‑compensation‑black‑threshold‑blend‑blue‑primary‑blue‑shift‑blur‑border‑bordercolor‑borderwidth‑brightness‑contrast‑cache‑canny‑caption‑cdl‑channel‑charcoal‑channel‑fx‑chop‑clahe‑clamp‑clip‑clip‑mask‑clip‑path‑clone‑clut‑coalesce‑colorize‑colormap‑color‑matrix‑colors‑colorspace‑combine‑comment‑compare‑complex‑compose‑composite‑compress‑connected‑components‑contrast‑contrast‑stretch‑convolve‑copy‑crop‑cycle‑debug‑decipher‑deconstruct‑define‑delay‑delete‑density‑depth‑descend‑deskew‑despeckle‑direction‑displace‑display‑dispose‑dissimilarity‑threshold‑dissolve‑distort‑distribute‑cache‑dither‑draw‑duplicate‑edge‑emboss‑encipher‑encoding‑endian‑enhance‑equalize‑evaluate‑evaluate‑sequence‑extent‑extract‑family‑features‑fft‑fill‑filter‑flatten‑flip‑floodfill‑flop‑font‑foreground‑format‑format[identify]‑frame‑frame[import]‑function‑fuzz‑fx‑gamma‑gaussian‑blur‑geometry‑gravity‑grayscale‑green‑primary‑hald‑clut‑help‑highlight‑color‑hough‑lines‑iconGeometry‑iconic‑identify‑ift‑immutable‑implode‑insert‑intensity‑intent‑interlace‑interpolate‑interline‑spacing‑interword‑spacing‑kerning‑kuwahara‑label‑lat‑layers‑level‑level‑colors‑limit‑linear‑stretch‑linewidth‑liquid‑rescale‑list‑log‑loop‑lowlight‑color‑magnify‑map‑map[stream]‑mattecolor‑median‑mean‑shift‑metric‑mode‑modulate‑moments‑monitor‑monochrome‑morph‑morphology‑mosaic‑motion‑blur‑name‑negate‑noise‑normalize‑opaque‑ordered‑dither‑orient‑page‑paint‑path‑pause[animate]‑pause[import]‑perceptible‑ping‑pointsize‑polaroid‑poly‑posterize‑precision‑preview‑print‑process‑profile‑quality‑quantize‑quiet‑radial‑blur‑raise‑random‑threshold‑range‑threshold‑read‑mask‑red‑primary‑regard‑warnings‑region‑remap‑remote‑render‑repage‑resample‑resize‑respect‑parentheses‑reverse‑roll‑rotate‑sample‑sampling‑factor‑scale‑scene‑screen‑seed‑segment‑selective‑blur‑separate‑sepia‑tone‑set‑shade‑shadow‑shared‑memory‑sharpen‑shave‑shear‑sigmoidal‑contrast‑silent‑similarity‑threshold‑size‑sketch‑smush‑snaps‑solarize‑sparse‑color‑splice‑spread‑statistic‑stegano‑stereo‑storage‑type‑stretch‑strip‑stroke‑strokewidth‑style‑subimage‑search‑swap‑swirl‑synchronize‑taint‑text‑font‑texture‑threshold‑thumbnail‑tile‑tile‑offset‑tint‑title‑transform‑transparent‑transparent‑color‑transpose‑transverse‑treedepth‑trim‑type‑undercolor‑unique‑colors‑units‑unsharp‑update‑verbose‑version‑view‑vignette‑virtual‑pixel‑visual‑watermark‑wave‑wavelet‑denoise‑weight‑white‑point‑white‑threshold‑window‑window‑group‑write‑write‑mask


Comments