DitherCam

Real time ordered dithering camera for iOS. Built in Swift Playgrounds, no Mac required.

Camera frames land as Metal textures with no CPU copy, get dithered in a fragment shader, and go straight to the screen at 60fps. The shutter runs the same shader into an offscreen target at the same pixel dimensions as the preview, so the saved photo is identical to the viewfinder rather than a re-render.

DOWNLOAD DitherCam.swiftpm.zip13 KB · iOS 17+

Install

  1. Download the zip on the iPhone or iPad you want to run it on.
  2. Unzip it in Files. You get a DitherCam.swiftpm folder.
  3. Tap it. Swift Playgrounds opens it as an app project. Press Run.
Free Apple ID signing gives you seven days before the app stops launching. Open the project in Swift Playgrounds and press Run again to re-sign. A paid developer account extends that to a year.

Palettes

1 Bit
Gray 4
DMG
Amber
Ice
CGA
Sunset
EGA

Bayer 2x2, 4x4 and 8x8. Adjustable pixel size, spread, contrast and brightness. Adding a palette is two lines in Palettes.swift, ceiling is 16 colors.

Source

Swift Playgrounds will not build files with a .metal extension, so the shader ships as .txt and is compiled at launch with MTLDevice.makeLibrary(source:). In the zip it lives in a Resources subfolder. The loose copy above is flattened for browsing.

Known limits