Computationally Yours · Handbook
Handbook · Foundations · Read in Week 1 · Srishti Manipal Interim 2026

Pixels, vectors, machines

Foundations. You don't need to be a programmer to start, but you do need a picture of what the computer is doing. This page covers the ideas that come up every day, with small things to try.

seed foundations · depth 6
Read
Before Day 6
Talk
Day 6, 9:30
No code
Needed to read it
Try
Three live demos
Back to
Techniques, Codex
01

From code to image

Code is a list of instructions. A program reads them in order, does the arithmetic, and writes the result somewhere: to the screen, or to a file.

1 · Write

Source

Plain text files in src/. You and Codex write these.

2 · Run

Execute

A program (a browser, Python, Node) reads the source and carries it out, line by line.

3 · Output

Draw or save

The result appears on screen, or is written to a file: SVG, PNG, STL.

Most creative-coding tools give you two places to write: setup, which runs once at the start, and draw, which runs again and again, many times a second, for animation. A still image for printing usually only needs setup, then a save.

02

Coordinates

Every mark has a position: x across, y down. On screens the origin (0, 0) is the top-left corner, and y grows downwards, the opposite of school graphs.

  • Units. Screens count pixels. Plotters and printers think in millimetres. Decide early which your system uses, and convert once, at export.
  • Angles are usually in radians, not degrees: a full turn is about 6.283 (2π), not 360.
  • Size independence. Write positions as fractions of the width and height (0.5 × width is always the middle), so the same system works on screen and on A2.
03

Pixels and vectors

A raster image is a grid of coloured pixels. A vector image is a set of instructions: draw a line from here to there, a circle this big. Zoom in and see the difference.

Raster · PNG
Vector · SVG
The raster was saved at 64 × 64 pixels: enlarging it only makes the squares bigger. The vector is redrawn sharply at any size.
RasterVector
StoresPixels in a gridPoints, lines, curves, shapes
EnlargedBlurs or turns blockyStays sharp
Good forTone, texture, colour fields, millions of marksLines, geometry, anything a pen will draw
FilesPNG, JPG, TIFFSVG, PDF
MachineArchival printerPen plotter (and laser cutters)

A pen plotter can only follow vectors. A printer needs pixels. If you might do both, keep your system's output as vectors and render pixels from them at the size you need.

04

Resolution

A pixel has no size until you print it. PPI (pixels per inch) says how many pixels fit into each inch of paper. Prints need about 300 PPI to look sharp up close.

One inch is 25.4 mm, so pixels = millimetres ÷ 25.4 × PPI. Your screen shows far fewer pixels than an A2 print needs, so render the print file at full size from the system, never by enlarging a screenshot.

05

Colour

Screen

Light: RGB

Red, green and blue light added together; all three at full is white. Written in code as rgb(219, 38, 31) or the hex code #db261f.

Paper

Ink: subtractive

Inks absorb light; more ink is darker. Some bright screen colours can't be printed, which is why prints can look duller than the screen.

A colour profile (ICC) describes how a device shows colour. Using the printer and paper's profile lets you preview the print on screen before you spend paper on it: see the archival guide.

06

CPU and GPU

The CPU is a few powerful workers that do tasks one after another. The GPU is thousands of simple workers that each do the same small job at the same moment, which is exactly what filling millions of pixels needs.

CPU · one worker
GPU · a worker per cell
384 cells to colour
Both compute the same colour for each cell. The CPU visits cells in turn; the GPU colours every cell in the same step. Real GPUs have thousands of cores; the CPU in your laptop has a handful.
  • Most of your system runs on the CPU: reading data, following rules, building paths. That's fine for drawings of thousands of lines.
  • The GPU matters for pixels: live animation, shaders, very large images, 3D previews.
  • Slow isn't broken. A complex system may take minutes to render one A2 file. Render a small preview while you work, and the full size only for export.
07

Rendering

Rendering is the work of turning your system's instructions into a finished image or file.

While you work

Real-time

Drawn fast enough to watch, often 60 frames a second, at screen size. Good for exploring parameters.

For production

Offline

Drawn once, as long as it takes, at full size: an A2 SVG, a 300 PPI TIFF, an STL. This is the file the machine uses.

Keep the two apart in your code: a preview mode that's quick, and an export mode that's exact. The same seed must give the same result in both.

08

Chance and seeds

Computers can't really be random. They use a formula that produces numbers that look random, starting from a number called the seed. Same seed, same sequence, same artwork.

That's what makes a generative work reproducible: the seed and the parameters are its recipe. Name every output by its seed; the system worksheet shows how. Noise, the smooth kind of randomness behind flow fields, is explained with a live sketch in Techniques.

09

Files you'll meet

FormatKindUsed for
.svgVectorPlotter files, line drawings, anything that must stay sharp
.pngRaster, losslessScreen outputs, log images, contact sheets
.jpgRaster, compressedPhotographs of the work; not for final art
.tifRaster, print qualityArchival print files with a colour profile
.pdfVector or rasterDocuments, sometimes print files
.stl / .obj3D meshResin printing; a surface made of triangles
.jsonText dataYour parameters in config/params.json
.csvText tableDatasets: one row per record, columns separated by commas
.mdTextMarkdown: your README, manifesto, log

A mesh describes a 3D form as many small triangles joined at their corners. For resin printing it must be watertight: closed all round, with no gaps, so the printer knows what's inside and outside. See the resin guide.