The concept of the program lies on image halftone procedure. The desire outcome of the program should be a reconstruction of the image structure.
Initial idea of the program is related to image tone, hue, and brightness changes.
1.2 Variable | Code
private void RunScript(string imageFile, double pointX, double pointY, double sizeX, double sizeY, double shift, Point3d localpoint, ref object B, ref object C){
//................................load image
System.Drawing.Bitmap mybmp = new System.Drawing.Bitmap(imageFile);
//................................image resolution
int rx = (mybmp.Width - 2);
int ry = (mybmp.Height - 2);
//.................................intialize storage lists
List<system.drawing.color> colors = new List<system.drawing.color>();</system.drawing.color></system.drawing.color>
List<point3d> pt = new List<point3d>();</point3d></point3d>
for (int j = 0; j < ry; j = j + 2) {
for(int i = 0; i < rx; i++) {
System.Drawing.Color c = mybmp.GetPixel(i, ry - j);
double val = c.GetBrightness();
double closerange = (Math.Pow(i - pointX, 2) + Math.Pow(j - pointY, 2));
double blubx = j + val + 30 / closerange;
pt.Add(new Point3d(i, blubx, 0.0));
}
for(int i = rx - 1; i > -1; i--) {
System.Drawing.Color c = mybmp.GetPixel(i, ry - j - 1);
double val = c.GetBrightness();
double closerange = (Math.Pow(i - pointX, 2) + Math.Pow(j - pointY + 2, 2));
double bluby = j + shift + val + 30 / closerange;
pt.Add(new Point3d(i, bluby, 0.0));
}
for(int i = 0; i < rx; i++) {
System.Drawing.Color c = mybmp.GetPixel(i, ry - j);
double val = c.GetBrightness();
double closerange = (Math.Pow(i - pointX, 2) + Math.Pow(j - pointY, 2));
double blubx = j - val - 30 / closerange;
pt.Add(new Point3d(i, blubx, 0.0));
}
for(int i = rx - 1; i > -1; i--) {
System.Drawing.Color c = mybmp.GetPixel(i, ry - j - 1);
double val = c.GetBrightness();
double closerange = (Math.Pow(i - pointX, 2) + Math.Pow(j - pointY + 2, 2));
double bluby = j + shift - val + 30 / closerange;
pt.Add(new Point3d(i, bluby, 0.0));
}
}
Curve crv = Curve.CreateInterpolatedCurve(pt, 3);
B = crv;