enter image description hereThe image is splitted into 8x8 blocks each of which are processed through DCT, quantization, huffman encoding/decoding, dequantization and inverse dct and used to recontruct the image. But there is a horrible blocking effect after this compression process. What would be the reason why this is happening? I simply create a new matrix for storing the data as big as the original image. And each block after processed is copied into new image. For example first 8x8 block is put from (0,0) to (7,7). The second block is put on the indices between (0,8) and (7,15)

  • $\begingroup$ so you compress your image in 8×8 blocks and get block artifacts with size 8×8? Is that surprising? $\endgroup$ Dec 17, 2018 at 9:43
  • $\begingroup$ @MarcusMüller Even though my compression ratio is too low, I get a result like this above $\endgroup$
    – Thunfische
    Dec 17, 2018 at 10:07
  • 2
    $\begingroup$ ah, with the edit, things are clearer. For some reason, your blocks are rotated by 90°. so, there's a bug you've got :) This puts this in the "how do I debug my own program" domain, and I'd argue Stackoverflow.com would be more helpful there; however, nobody will be able to help you without knowing your code. $\endgroup$ Dec 17, 2018 at 10:46
  • $\begingroup$ Might be a transposition error in the left and right DCT multiplies on each block $\endgroup$ Dec 17, 2018 at 12:06
  • $\begingroup$ @MarcusMüller Thank you so much. Yes what i did wrong was indeed an index error $\endgroup$
    – Thunfische
    Dec 17, 2018 at 12:21


Browse other questions tagged or ask your own question.