File in PixelStudio.st first. Select each complete expression in a Workspace and Do it. Open a real image editor PSStudioMorph open. Open the sample, draw on Garden, and inspect the returned studio. Send self model layers to inspect the native 32-bit Forms. ---------------------------- Paint pixels through a mouse gesture | editor document | editor := PSStudioMorph open. document := editor model. document newDocument; paintColor: Color red; brushSize: 18. document beginEdit. document strokeFrom: 80@80 to: 380@240 erase: false. document commitEdit. editor Choose Brush, select a palette color, and change the brush slider. Drag across the canvas. Choose Eraser to write transparent pixels into the selected layer and reveal the layers below. ---------------------------- Preview a shape, then commit it | editor document | editor := PSStudioMorph open. document := editor model. document addLayer; paintColor: Color blue. document beginEdit. document shapeFrom: 330@50 to: 450@110 ellipse: true. document commitEdit. editor Choose Ellipse and drag in either direction. Choose Eyedropper, click a visible flower color, then paint with that sampled color. ---------------------------- Composite separate raster layers | editor document | editor := PSStudioMorph open. document := editor model. document opacity: 0.45. document beginEdit. document moveActiveLayerTo: 30@0. document commitEdit. editor Select Garden, lower its opacity, hide/show it, then drag with Move layer. Add a new layer, rename it with Return, and use Up/Down to change which pixels cover the others. ---------------------------- Undo a document, not just a widget | editor document before | editor := PSStudioMorph open. document := editor model. before := document compositeForm bits copy. document invert; undo. (document compositeForm bits = before) ifFalse: [self error: 'Undo did not restore pixels']. editor Paint one stroke and press Undo/Redo. Change layer opacity or apply an effect and undo it. Undo, make a fresh edit, then try Redo: the old branch has been discarded. ---------------------------- Filter the active layer | editor | editor := PSStudioMorph open. editor model grayscale. editor Select Garden and press Grayscale layer or Invert layer. Undo restores color. Select Backdrop and repeat to see that effects operate on the selected bitmap. ---------------------------- Read and write actual PNG files | editor | editor := PSStudioMorph open. editor model acceptFileName: 'PixelStudio-export.png'. editor model exportPNG. editor Enter a full PNG path and press Return, then Import PNG. For export, enter the destination path, accept it, and press Export PNG. Export replaces a file at that accepted path.