samedi 20 juillet 2024

Gems from Rebol

Each version of Rebol includes pearls that make image processing easy.

In Rebol 2, for example, you can find an extremely fast convolution function.  

You'll find here http://www.rebol.com/view/demos/convolve.r, the demo of convolution effect (By Cyphre).

I remember presenting Rebol at the Hanoi Polytechnic University (https://bachkhoahanoi.edu.vn/) a long time ago, and colleagues were impressed by the speed of a simple interpreted script designed for convolution.

Basically, this function uses a 3 by 3 kernel and offers various filters such as emboss and others. But you can also create your own filter.


These ideas have been implemented in redCV and you can find several examples in the RedCV/samples/image_convolution directory.

Recently, I did a little digging into the Rebol 3 version developed by Oldes (https://github.com/Siskin-framework/Rebol) and also found a few gems. 

The first is blur function which allows a Gaussian blurring of any image.
USAGE:
     BLUR image radius

DESCRIPTION:
     Blur (Gaussian) given image. 
     BLUR is a native! value.

ARGUMENTS:
     image         [image!]   Image to blur (modified).
     radius         [number!]  Blur amount.

radius must be positive and > 1. If radius = 1 you'll get an un-blurred image as result.


The second one is rgb-to-hsv function: 

USAGE:
     RGB-TO-HSV rgb

DESCRIPTION:
     Converts RGB value to HSV (hue, saturation, value). 
     RGB-TO-HSV is a native! value.

ARGUMENTS:
     rgb           [tuple!] 
     
Of course yo'll get the inverse function hsv-to-rgb:
USAGE:
     HSV-TO-RGB hsv

DESCRIPTION:
     Converts HSV (hue, saturation, value) to RGB. 
     HSV-TO-RGB is a native! value.

ARGUMENTS:
     hsv           [tuple!]   






Thanks to these fabulous developers for offering us such easy-to-use tools.






Aucun commentaire:

Enregistrer un commentaire