Skip to content

Instantly share code, notes, and snippets.

View SunnyBe's full-sized avatar
🎯
Focusing

Sunday Ndu SunnyBe

🎯
Focusing
View GitHub Profile
@SunnyBe
SunnyBe / gist:7bef26bcac4781fe8c6ddb6240195bee
Last active June 17, 2026 15:59
Generate BMP image using ByteArray
fun main() {
val outputStream = ByteArrayOutputStream()
writeBmpHeader(outputStream)
writeDIBHeader(outputStream)
// BGR
val red = byteArrayOf(0, 0, -1)
val blue = byteArrayOf(-1, 0, 0)
val white = byteArrayOf(-1, -1, -1)