Image Codec

Objective: Create an image codec that compresses the image file and applies a color filter that makes the image look vintage.

This project seeks to combine data compression and the recreation of an “Instagram filter”.

The user first loads an image into the program. By clicking on File>Open.

UI of Image Codec

Then the user clicks on the Codecs menu and selects a Codec to apply to the image. This image can then be saved. The statistics of the image will then appear on the right hand column.

Image with Vintique codec applied

I create a codec called “Vintique” (a combination of the words “vintage” and “antique” to create a codec that would apply a sepia-colored filter and compress the image.

Features:

  • The codec encodes a row-major traversal of the image (i.e., row-by-row, top-to-bottom, left-to-right)
  • Each pixel is represented by a one-byte weighted “Vintique” value, as defined by the Pixel class with RGB ratios of 43.9% RED, 25.9% GREEN, and 7.8% BLUE
  • The image is compressed with a reduction of 66.6%
Original image
Original stats
Image with Vintique
Vintique image stats

After applying the Vintique codec, the image had a losslessness of 0.2% accuracy. This means that almost all of the data from the original image is lost with this codec.

Outcomes:

  • Be mindful of how filters and image types (JPG, PNG, ect.) affect the data and quality of the your images
  • First experience manipulating images in a Java program
  • Better understanding of data compression and digital image types

Leave a comment