-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCheckMagenta.cs
More file actions
22 lines (21 loc) · 797 Bytes
/
Copy pathCheckMagenta.cs
File metadata and controls
22 lines (21 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System;
using System.Drawing;
using System.IO;
class Program {
static void Main() {
string path = "C:\\Users\\danat\\.gemini\\antigravity\\brain\\389e4a53-b1e6-440c-b190-0f5c509fa8c4\\Terrain_View_B_0.png";
if (!File.Exists(path)) { Console.WriteLine("File not found"); return; }
Bitmap bmp = new Bitmap(path);
int magentaCount = 0;
int totalPixels = bmp.Width * bmp.Height;
for (int y = 0; y < bmp.Height; y++) {
for (int x = 0; x < bmp.Width; x++) {
Color c = bmp.GetPixel(x, y);
if (c.R > 200 && c.G < 50 && c.B > 200) {
magentaCount++;
}
}
}
Console.WriteLine("Magenta pixels: " + magentaCount + " / " + totalPixels);
}
}