Hi,
I have made some mathematical images by using some formula through SetPixel in C#.
The problem is that these images are
blur to some extend.
By doing some
quantizing I have made it better. But still it is not the favorite image that can be.
Does anyone know what is called such a work?
How to improve these kind of images?
Does anyone know any article about these king of images?
public int ColorQuantize(double color,int step)
{
return ((((int)color) / step)+1) * step;
}
public void RGB(int i, int j, double x, double y, ref double r, ref double g, ref double b)
{
r = ColorQuantize(Math.Sqrt(Math.Abs(Math.Atan(x / y) * Math.Sin(x * Math.PI - y)) * 2 / Math.PI) * 256, 40);
g = ColorQuantize((Math.Tan(x) * Math.Tan(x-y) + Math.Tan(y*x) * Math.Tan(y)) * 256, 40);
b = ColorQuantize(Math.Cos(Math.Sqrt(Math.Abs(x * y)) * 7-Math.Tan(x*x+y*y)) * 256, 40);
}
public Bitmap myImage()
{
double dimX, dimY;
dimX = pictureBox1.Size.Width;
dimY = pictureBox1.Size.Height;
Bitmap bmp = new Bitmap((int)dimX, (int)dimY);
int HalfX = (int)(dimX / 2), HalfY = (int)(dimY / 2);
for (int i = 0; i < dimX; i++)
for (int j = 0; j < dimY; j++)
{
double r = 0, g = 0, b = 0;
int X = i - HalfX, Y = j - HalfY;
RGB(X, Y, X / (dimX / 2), Y / (dimY / 2), ref r, ref g, ref b);
r = (int)(Math.Abs(r) % 256);
g = (int)(Math.Abs(g) % 256);
b = (int)(Math.Abs(b) % 256);
bmp.SetPixel(i, j, Color.FromArgb((int)r, (int)g, (int)b));
}
return bmp;
}