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)


closed as off-topic by Marcus Müller, MBaz, Matt L., A_A, lennon310 Dec 18 '18 at 16:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "General programming questions are off-topic here, but can be asked on Stack Overflow." – Marcus Müller, MBaz, Matt L., A_A, lennon310
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ so you compress your image in 8×8 blocks and get block artifacts with size 8×8? Is that surprising? $\endgroup$ – Marcus Müller Dec 17 '18 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 '18 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$ – Marcus Müller Dec 17 '18 at 10:46
  • $\begingroup$ Might be a transposition error in the left and right DCT multiplies on each block $\endgroup$ – Laurent Duval Dec 17 '18 at 12:06
  • $\begingroup$ @MarcusMüller Thank you so much. Yes what i did wrong was indeed an index error $\endgroup$ – Thunfische Dec 17 '18 at 12:21

Browse other questions tagged or ask your own question.