File:Aliased.png
Aliased.png (128 × 128 pixels, file size: 781 bytes, MIME type: image/png)
File information
Structured data
Captions
Summary edit
DescriptionAliased.png |
English: Aliased chessboard |
Date | 24 January 2003 (original upload date) |
Source | Created with a variant of this program, which I (Loisel 03:56 Jan 24, 2003 (UTC)) wrote myself. |
Author | Loisel at English Wikipedia |
Licensing edit
Loisel at the English Wikipedia, the copyright holder of this work, hereby publishes it under the following license:
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license. | ||
Attribution: Loisel at the English Wikipedia | ||
| ||
This licensing tag was added to this file as part of the GFDL licensing update.http://creativecommons.org/licenses/by-sa/3.0/CC BY-SA 3.0Creative Commons Attribution-Share Alike 3.0truetrue |
C src code edit
Original code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <assert.h>
int color(double x, double y)
{
double t,z;
int i,j,k;
x=x/128.0-0.5;
y=y/2048.0;
t=1.0/(y+0.001);
z=t*x;
i=floor(t);
j=floor(z);
k=i+j;
/* printf("%f %f -> %i %i %i\n",t,z,i,j,k%2); */
return ((k%2)!=0);
}
double myrand()
{
return rand()/((double)RAND_MAX);
}
int main()
{
int i,j,k,l;
double x,y;
printf("P5\n128 128\n255\n");
srand(time(0));
for(i=0;i<128;i++)
for(j=0;j<128;j++)
{
k=0;
for(l=0;l<255;l++)
{
x=j+myrand();
y=i+myrand();
k+=color(x,y);
}
assert(k>=0 && k<=255);
putchar(k);
}
}
New code with only small changes :
To compile :
gcc a.c -Wall -lm
to run :
./a.out >a.pgm
To convert using Image Magic :
convert 5000.pgm -resize 1000x1000 a.png
// https://commons.wikimedia.org/wiki/File:Aliased.png
// gcc a.c -Wall -lm
// gcc a.c -Wall -lm
// ./a.out >a.pgm
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <assert.h>
int iMax =5000;
int jMax ;
int color(double x, double y)
{
double t,z;
int i,j,k;
x=x/(1.0*iMax)-0.5;
y=y/(jMax*6);
t=1.0/(y+0.001);
z=t*x;
i=floor(t);
j=floor(z);
k=i+j;
/* printf("%f %f -> %i %i %i\n",t,z,i,j,k%2); */
return ((k%2)!=0);
}
double myrand()
{
return rand()/((double)RAND_MAX);
}
int main()
{
int i,j,k,l;
double x,y;
jMax = iMax;
printf("P5\n %d %d\n255\n", iMax, jMax);
srand(time(0));
for(i=0;i<iMax;i++)
for(j=0;j<jMax;j++)
{
k=0;
for(l=0;l<255;l++)
{
x=j+myrand();
y=i+myrand();
k+=color(x,y);
}
assert(k>=0 && k<=255);
putchar(k);
}
return 0;
}
Source code was formatted with Emacs using GNU style.
Original upload log edit
The original description page was here. All following user names refer to en.wikipedia.
- 2007-09-15 05:17 Dicklyon 128×128×8 (892 bytes) Reverted to version as of 13:34, 30 September 2005
- 2007-09-14 22:56 AzaToth 1600×1200×8 (42986 bytes) remade it in povray
- 2005-09-30 13:34 Riumplus 128×128×8 (892 bytes) Losslessly recompressed the image, shrinking file size by 39%
- 2003-01-24 20:28 Loisel 128×128×8 (1450 bytes) slightly bugfixed image
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 09:49, 17 May 2023 | 128 × 128 (781 bytes) | Phreneticc (talk | contribs) | Reduced file weight with FileOptimizer in lossless compression mode. | |
16:06, 27 July 2014 | 128 × 128 (892 bytes) | OgreBot (talk | contribs) | (BOT): Reverting to most recent version before archival | ||
16:06, 27 July 2014 | 1,600 × 1,200 (42 KB) | OgreBot (talk | contribs) | (BOT): Uploading old version of file from en.wikipedia; originally uploaded on 2007-09-14 22:56:12 by AzaToth | ||
16:06, 27 July 2014 | 128 × 128 (1 KB) | OgreBot (talk | contribs) | (BOT): Uploading old version of file from en.wikipedia; originally uploaded on 2003-01-24 20:28:17 by Loisel | ||
06:19, 27 July 2014 | 128 × 128 (892 bytes) | LocalH (talk | contribs) | reverted to previous version, was aliased for descriptive purposes | ||
18:14, 27 June 2014 | 1,000 × 1,000 (154 KB) | Soul windsurfer (talk | contribs) | better quality | ||
19:43, 3 May 2007 | 128 × 128 (892 bytes) | MrHyde~commonswiki (talk | contribs) | {{Information |Description= |Source= |Date= |Author= |Permission= |other_versions= }} |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on ar.wikipedia.org
- Usage on ca.wikipedia.org
- Usage on en.wikipedia.org
- Usage on en.wikibooks.org
- Usage on es.wikipedia.org
- Usage on fa.wikipedia.org
- Usage on it.wikipedia.org
- Usage on lt.wikipedia.org
- Usage on ms.wikipedia.org