package main

import (
	"fmt"
	"image"
	"time"

	"github.com/voxelbrain/pixelpixel/imageutils"
	"github.com/voxelbrain/pixelpixel/protocol"
)

func main() {
	c := protocol.PixelPusher()
	img := protocol.NewPixel()

	dImg := imageutils.DimensionChanger(img, 4, 6)
	for i := 0; i < 5; i++ {
		color := imageutils.Green
		if i > 3 {
			panic("CRASH")
		} else if i == 3 {
			color = imageutils.Red
		}
		imageutils.FillRectangle(dImg, image.Rect(0, 0, 4, 6), imageutils.Black)
		imageutils.DrawText(dImg, image.Rect(0, 0, 4, 6), color, fmt.Sprintf("%d", 3-i))
		c <- img
		time.Sleep(1 * time.Second)
	}
}

package main

import (
	"image/color"
	"time"

	"github.com/voxelbrain/pixelpixel/imageutils"
	"github.com/voxelbrain/pixelpixel/protocol"
)

func main() {
	c := protocol.PixelPusher()
	img := protocol.NewPixel()

	dImg := imageutils.DimensionChanger(img, 4, 1)
	for i := 0; i < 5; i++ {
		if i < 3 {
			dImg.Set(i, 0, color.RGBA{uint8(100 + i*70), 0, 0, 255})
		} else if i == 3 {
			dImg.Set(i, 0, color.RGBA{0, 255, 0, 255})
		} else {
			panic("CRASH")
		}
		c <- img
		time.Sleep(1 * time.Second)
	}
}

--- 
+++ 
@@ -1,7 +1,8 @@
 package main
 
 import (
-	"image/color"
+	"fmt"
+	"image"
 	"time"
 
 	"github.com/voxelbrain/pixelpixel/imageutils"
@@ -12,15 +13,16 @@
 	c := protocol.PixelPusher()
 	img := protocol.NewPixel()
 
-	dImg := imageutils.DimensionChanger(img, 4, 1)
+	dImg := imageutils.DimensionChanger(img, 4, 6)
 	for i := 0; i < 5; i++ {
-		if i < 3 {
-			dImg.Set(i, 0, color.RGBA{uint8(100 + i*70), 0, 0, 255})
+		color := imageutils.Green
+		if i > 3 {
+			panic("CRASH")
 		} else if i == 3 {
-			dImg.Set(i, 0, color.RGBA{0, 255, 0, 255})
-		} else {
-			panic("CRASH")
+			color = imageutils.Red
 		}
+		imageutils.FillRectangle(dImg, image.Rect(0, 0, 4, 6), imageutils.Black)
+		imageutils.DrawText(dImg, image.Rect(0, 0, 4, 6), color, fmt.Sprintf("%d", 3-i))
 		c <- img
 		time.Sleep(1 * time.Second)
 	}
Rewrite crash with actual textual countdown
