$extrastylesheet
After this step you should know how to:
First create an empty color image with a box2d of 40x40 as domain.
If you want to initialize the image with the color red, simply call data::fill as follows:
Updating a site value is also possible using operator() or the opt::at() routine. Here we create a blue square of 10x10 pixels from site (20, 20) to (30, 30).
The corresponding image:
An image can also be initialized/modified thanks to another image. Let’s load a new image.
If we want to initialize ima with lena, we can use data::fill:
Likewise, it is possible to paste data from an image to another:
More details can be found in sections Access and modify values , Fill and Paste in the reference guide.