Quote:
I do not know really which error I have done to get this result.
First error is that you have wrong expectations.
An uncompressed bitmap image of dimension 320*240 and 16 bits per pixel got a size of 320*240*2 bytes + headers, which is a bout 320*240*2= 153600 bytes + headers.
With 4 bits per pixel, it is 320*240*0.5= 38400 + headers.
Size is divided by 4 without dimension change.
So, expecting 250KB from 500KB imply other values or dimension increase.
Quote:
I get a very small file of 11 KB
Note that a bmp can be compressed too.
BMP file format - Wikipedia[
^]
You also forgot to tell what characteristics are the 500KB image.
[Update]
Quote:
I forget to tell you: 500KB is the hex string of the image(.bmp) so when I apply dithering and bitreduction I try to convert the bitmap to a hex string(stringToTest) and this string pasted in a text document in a form (0x45, 0x55 ....) must have less than 500KB (ex: 250KB) and with this file I could with another program try to build the image to examin it
In France we have a colorful saying which fit what you did: "Why make things simple when you can make them complicated ?"
Reducing an image is not a UI thing.
Procedure: Input parameter: file name and path, Output parameter: file name and path
- Read image to byte array.
- Apply dithering and reducing colors algorithm to another byte array.
- Write resulting file.