dbox
Junior Member
Posts: 83
|
Post by dbox on Nov 10, 2022 21:04:56 GMT
One of the things that I really wanted to bring to QBJS was the ability to include functionality from the wealth of Javascript libraries available today in an accessible way. As an example, I put together a little proof of concept that utilizes the powerful CaymanJS image processing library. It allows you to do some pretty advanced image processing that you would typically find in an imaging editing tool like photoshop programmatically. Import ImgProc From "https://raw.githubusercontent.com/boxgaming/qbjs/main/samples/include/caman.bas"
Screen _NewImage(844, 563)
Dim img As Long img = _LoadImage("landscape.jpeg") _PutImage , img
_Delay 1
Dim options As Object 'options.brightness = 10 options.contrast = 10 'options.saturation = 100 'options.exposure = -30 options.sepia = 60 'options.blur = 10 'options.noise = 10 'options.clip = 30 'options.sharpen = 80 'options.hue = 30
ImgProc.Render options View in QBJSUncomment any of the other attributes to try out the various combinations of operations that can be performed.
|
|
dbox
Junior Member
Posts: 83
|
Post by dbox on Nov 10, 2022 21:39:23 GMT
Replace starting at line 11 with the following and you get a cool blur fade-out effect:
Dim options As Object options.blur = 1 options.brightness = -1
Dim i As Integer For i = 1 To 100 ImgProc.Render options _Limit 60 Next i
|
|