| Task | Command | Parameters | Description |
| set subimage bounds |
|
left top right bottom | Defines a window on the original image. Any subsequent commands will be clipped to this window. The subimage will be the size and shape of this window. If you don't set bounds, they are automatically calculated for each subimage, and will be just large enough to hold the shapes you give commands for (but no larger than the original image). |
| copy rectangle from image |
|
left top right bottom | Copy a rectangle from the original image to the subimage. Pixel colours are copied as is. If bounds have been set, only that part of the rectangle within bounds will be copied. |
| copy circle from image |
|
x y radius | Copy a circle from the original image to the subimage. The circle is centred at (x,y) and has the given radius. Pixel outside the circle are left unchanged in the subimage. If bounds have been set, only that part of the circle within bounds will be copied. |
| copy patch from image |
|
x y | Copy the (FRAGSTAT-style) patch containing the point (x,y) from the original image to the subimage. The patch will be the same colour as the original. Pixels outside the patch are left unchanged in the subimage. |
| fill rectangle in subimage |
|
left top right bottom colour | Fill a rectangle in the subimage with pixels of the given colour. |
| fill circle in subimage |
|
x y radius value | Fill a circle in the subimage with pixels of the given colour. |
| fill outside circle in subimage |
|
x y radius value | Fill outside a circle in the subimage with pixels of the given colour. All pixels not within the circle are coloured. |
| fill patch in subimage |
|
x y value | Copies the patch containing point (x,y) from the original image to the subimage, changing the patch colour to the given value. |
| save subimage |
|
filename | Save the subimage in fragstat format to the given file. Subsequent commands create a new subimage. |
| save subimage and keep |
|
filename | Save the subimage in fragstat format to the given file. Subsequent commands continue operating on this subimage. |
| save subimage as Windows bitmap |
|
filename | Save the subimage as a Windows bitmap in the given file. Subsequent commands create a new subimage. |
| save subimage as Windows bitmap and keep |
|
filename | Save the subimage as a Windows bitmap in the given file. Subsequent commands continue operating on this subimage. |
|
|
|
| Original image in file demo.img
|
right: 450 top: 450 bottom: 100 |
| c 320 240 200
wk demo1 |
Copy a circle from the original image, setting the background to black
(the colour 0) as specified above.
Using wbk instead of wb means subsequent commands will continue to operate on this subimage. |
| fc 320 240 100 5
wk demo2 |
Fill a circle with colour 5 (blue-green). |
| r 280 200 360 280
w demo3 |
Copy a rectangle from the original image. |
| b 100 100 400 400
p 320 240 wk demo4 |
This is a new subimage because the previous command was wb, not wbk. Set subimage bounds to a square. Copy the patch containing point (320, 240) from the original image, preserving its colour. Patches are defined just as in FRAGSTAT. (If you learn to use cookie.exe directly, you can specify the -n option that tells it not to search diagonally for cells belonging to the same patch. FRAGSTAT also has this option.) |
| p 200 350
wk demo5 |
Copy another patch. |
| fp 150 150 16
wk demo6 |
Fill in the patch containing point (150, 150) with the colour 16 (bright red). The shape of the region being filled comes from the original image, not the current subimage; that's why the black borders around the orange blots remain. |
| fcc 320 240 150 5
w demo7 |
Fill outside the circle centred at (240, 150) with radius 150 using the colour 5 (blue-green). |
This command also generated the file dofrag.bat, which you can
run by typing dofrag at the DOS command prompt.
Here it is:
This page, cookie and docookie are by John Brzustowski (junkjbrzusto@ualberta.cacaca but removing the obvious parts), who also substantially rewrote fragstat it to use run-length encoding, for substantial time and memory savings. (e.g. a 9500 x 13000 image, ~118 Mbytes in size, will run on a DOS box with 64 Mbytes of RAM without swapping to disk.) You are free to use, redistribute, and modify them. Please direct any questions, complaints, or comments about this page or the programs in the distribution to John.
cookie.html 17 November, 2000