You are viewing the course site for a past offering of this course. The current offering may be found here.
Lecture 20: Image Processing (16)
gowenong

Line-based illustrations or rasterized text have very sharp differences between pixels (white adjacent to black pixel, for ex). This means that when being compressed with JPEG, the nxn pixel blocks will average out a certain area to a very different color (such as gray), leading to the picture looking very jagged rather than straight.

tlswoo

I agree with @gowenong here, since the averaging of blocks of pixels probably won't work well with high-contrast areas. When comparing quality levels, you can see that even starting at quality level 9 there are already discolorations in the background, which become very apparent by quality level 1. Even if the background color wasn't completely white, the concentrated color of the text, plus the very defined shapes, would probably result in a similar unsatisfactory compressed image.

xinwei-zhuang

so what's a good way to compress text?

Rishiparikh

I'm not sure I am following the first example, but it brings up an interesting point - we don't want jaggies in text. Personally, in text what's the most important is the actual edges and curves that allow me to distinguish different letters. On another note, what I thought was really interesting is that if I were to read this text from afar, similar to how actual size 12 font would look when reading, I cannot tell much of a difference between original and even level 6. This tells me that we can compress text a lot more than we can compress images.

Crazy010517

@xinwei-zhuang I'm thinking one alternate way to compress text is probably to directly save the letters, font, and position and recreate it when displaying the image. However, this would require knowing what the font is so it may not be feasible unless there's some machine learning assistance involved.

bernardmc8

I am surprised that text is just compressed as though it were an image. Like Crazy010517 suggested, I would think that personal devices save how each letter of a font look and then an application might just say which type of font should be used and the device will load it locally itself. It seems redundant to load text as images, as in text, letters are repeated and so each letter would only need to be compressed and sent over once at the most

adityaramkumar

What if we just represent the JPEG as a text file (with rgb values correspondingly) and then use something like Huffman encoding? Then we'll be able tor recreate the image perfectly? Alternatively, since our rgb values are from 0-255, we can use a 0-255 "alphabet" for our encoding.

nobugnohair

Since texts have only one color, could we take advantage of that and filter out color values that are very high to simply white?

shreyaskompalli

I think @nobugnohair's strategy could work, as long as we take into account the fact that we can color fonts with any color. For instance, if the text is yellow, then we would likely have to adjust the cutoff value from which we filter out color values.

You must be enrolled in the course to comment