Grayscale image: Difference between revisions

m
Line 955:
=={{header|FutureBasic}}==
There are several ways to handle grayscaling images in FB. Here's a function that accepts any of a variety of color images — JPEG, TIFF, PNG, BMP, GIF, etc. — and converts them to grayscale. The function uses a convenient build-in Core Image filter to generate the optimized grayscale image. This code compiles as a standalone application featuring a window with two image views, one showing the original color image, and the other with the converted grayscale image. The app uses a relatively square color image of flowers. It proportionately resizes the image to fit the left hand image view, and displays the converted image in the right hand view.
 
Resource: [[Media:FlowersFB.jpg]]
 
<syntaxhighlight lang="text">
include resources "flowers.jpg"
416

edits