Saturday, July 7, 2018

ANTILOG_07July18a

###

ANTILOG_07July18a

###

15:22 2018-07-07

- I just did an experiment; I wanted to see what the correlation was between the configuration of pixel values of a digital image and its size in kilobytes; I created an image that is ALL WHITE, i.e. every pixel has the same value, white, and it is 2.34 kilobytes:
All White. 2.34 kilobytes. A.G. (c) 2018. All Rights Reserved.
- The image is all white pixels and is 256 pixels wide by 256 pixels high; That means that there are 65,536 pixels in all, which can have a value between 0 and 256;
- I made another 256 pixel by 256 pixel image but with Gaussian white noise, which is 98.6 kilobytes:
Gaussian white noise. 98.6 kilobytes. A.G. (c) 2018. All Rights Reserved.
- So random pixels makes a digital file that is much bigger, heavier, than an image where all the pixels are the same; I made another experience, I made bigger pixels:
Large Pixels, random. 12.4 kilobytes. A.G. (c) 2018. All Rights Reserved.
- Here we see that if I reduce the number of "random" pixels to a smaller number, with bigger pixels, the same 256 px by 256 px image is only 12.4 kilobytes; Technically speaking, if it was really a bitonal image, with ONLY completely WHITE pixels OR ONLY completely BLACK pixels, for different combinations of black and white pixels in a bitonal image, each pixel would be worth roughly 1-bit, because it's a simple decision between two possible values, which is 1-bit at the minimum; These images are in JPEG and I think JPEG is supposed to use compression, I'm not sure, I would have to look it up; I still don't know why an all-white image is 2.34 kilobytes, which is 1000 bytes per kilobyte:
Random black and white large pixels, 2.85 kilobytes. A.G. (c) 2018. All Rights Reserved.
- Here you can see that a bitonal image with large black pixels is 2.85 kilobytes; compare it to the all-white image, which was 2.34 kilobytes; I'm surprised that these images are so large, technically it would take less bytes than that, at least in my conception; there are only 256 pixels by 256 pixels, with 256 possible values for each pixel; The image with Gaussian noise was 98.6 kilobytes, so for 65,536 pixels, that's roughly 1.5 bytes per pixel; one byte is 8 bits representing a binary number;
- In any case, the last image is a one-bit bi-tonal black-and-white image which, in the context of computer imaging, is an image with only two colors: black and white (also called bilevel or binary images); This kind of image seems to take less storage space; I'm going to have to investigate this further to know why an all-white-pixel image can have so many bytes in JPEG format;
- In any case, the main idea here was that random pixels in greyscale is harder to compress, you get an image which is "heavier" in terms of kilobytes in storage, because the randomness cannot really be compressed, whereas an all-white-pixel image is easy to compress since it's just one pixel value for every pixel, i.e. it has very high "redundancy", which is key in its "lightness" in terms of kilobytes.
* * *
15:50 2018-07-07

- Another experiment I did was with what is called "stochastic resonance", something that one finds in image processing, amongst other places;
- Basically the idea is that I took an image, here it is the image in the top-left corner, and I used a "threshold" function on it, to give the image at the top-right; The idea is that the threshold function just takes greyscale pixel values and at a decided value, i.e. the "threshold", it decides whether each pixel is above or below that value and so changes the pixel values for the entire image based on the threshold; The result is a black and white "binary image"; pixel values below the threshold turn to white, and those above it turn to black, I think that's how it works;
- In the image on the bottom-left, I added Gaussian noise, and then in the image on the bottom-right, I used the same threshold function; Notice that there is more detail, adding noise to the "signal" before the function gave an image with much more detail; That's a result of stochastic resonance; Here is the image it gives, and I hope this all made sense to you, dear readers:
Experiment with stochastic resonance. A.G. (c) 2018. All Rights Reserved.
- The noise changes the way the threshold function functions; You get a different result; I think that adding noise to signals can make huge differences; In my sound design I'm always adding noise because in real life there is always noise, so for me for digital music to sound like real music, it requires some noise, just to make it sound natural, like things sound in real life.

No comments:

Post a Comment