1) get some good books on compiler design and algorithms.
2) as many as your operating system will support OR as many as the image file has encoded into it, whichever is smaller. The display functions are handled by the operating system, the browser just tells the OS what to show where on screen.
Cheers but how do I find-out how many colours my OS handles ?
How do I know which colour represents which machine code "1"s and "0"s or should I have said that the other way round ?
eg.
11111110 = sky blue
11111100 = navy blue
11111000 = dark blue
and so on.
I will tell you what I am really looking for in a browser's source code......
I am looking for something (C Codes) like this in a browser's source-code...
(Imagine the CAPITAL LETTERS are C codes).
IF FILE HAS "sky blue" FOR A PIXEL THEN DISPLAY THAT AS 11111110 TO THAT PIXEL.
IF FILE HAS "navy blue" FOR A PIXEL THEN DISPLAY THAT AS 11111100 TO THAT PIXEL.
Now, if I switch the colours then the browser will display different colour.
eg. If I switch on the source code the colour code like this...
IF FILE HAS "sky blue" FOR A PIXEL THEN DISPLAY THAT AS 0000000 TO THAT PIXEL.
IF FILE HAS "navy blue" FOR A PIXEL THEN DISPLAY THAT AS 0000001 TO THAT PIXEL.
Imagine that 00000000 = black
and
00000001 = white.
Now, an image that is sky-blue will display white in my updated browser because I changed the colour codes from it's source code.
I want to do this to experiment.
I want to change like this not only the colours but the html and javascript too. So, my updated browser will translate html and javascript differently.
It will translate according to "my instructions".
And to do this, I must find the appropriate C instructions in a browser so I can experiment like this.
I am getting into programming and so I just want to experiment this and that. That's all.
Oh by the way, why did you ask me to get a book on how to build a compiler ? What has that got to do with any of this ?
Frankly, one day, God willing, I will do just that but not just yet.
Must start on small things first.
One day I will do the same to C compiler.
I will be looking for something (C Codes) like this in the C compiler's source-code...
(Imagine the CAPITAL LETTERS are C codes that instruct the compiler what do if a certain function is in the programmer's software's source-code).
IF SOURCE CODE HAS "printf " THEN PRINT ON SCREEN.
Now, what I will do is replace that with :
IF SOURCE CODE HAS "print " THEN PRINT ON SCREEN.
so now, in my updated C compiler you a programmer won't have to type the silly "printf" to command the program to spit some-thing on the screen.
You will simply type the english word "print".
I will do this with the other functions too.
So now you know, what I want to do to a compiler.
Frankly, what I want to do to a browser is the same.
And that is why, I must find-out where on the C compiler's source code the instructions are for each function.
I must find-out where it says that "printf" means "print on screen" so that I can replace the "printf" with "print".
I must know likewise for the other functions so I can change them too.
And the same goes for the browser to change how it should translate colours and html tags and Javascript codes.
I must be pointed to the right specific lines of codes inside a browser and the C compiler because I don't have time to read through billions of lines of codes.
Get it ?