Image compression

how does it work?



The image compression function is a feature of our app that allows you to reduce the size of your images without losing much quality. It uses the Fourier transform, which is a mathematical technique that can convert an image into a sum of complex exponentials of varying magnitudes, frequencies, and phases. These components are also called frequency components, because they represent how much each frequency contributes to the image.



The human eye is more sensitive to low-frequency components than high-frequency components. Low-frequency components correspond to smooth variations in the image, such as edges and shapes. High-frequency components correspond to rapid variations in the image, such as textures and details. By discarding some of the high-frequency components that are less visible to the human eye, we can reduce the size of the image while preserving most of its quality. This is called frequency domain compression.


Our app lets you input how much you want to keep by entering a number between 0 and 100. This number represents the percentage of low-frequency components that you want to retain in your compressed image. The higher the number, the better the quality but also the larger the size. The lower the number, the worse the quality but also the smaller the size. You can experiment with different numbers and see how they affect your images.


The image compression function currently works only for grayscale images. Grayscale images have only one color channel (intensity), so they are easier to process with Fourier transform than colorful images. Colorful images have three color channels (red, green, blue), so they require more computations and storage space with Fourier transform. However, we are working on adding an option for colorful images soon. Stay tuned for more updates!


click here for more information about the fourier transform itself