# Why DCT is good for image coding?

In my last post, I use real image block data to test the DCT transform. Using this data, we can check the advantage of using DCT for image coding. Here is our first test data.
By following code, we can get the inverse result of DCT transform.
[code lang=“python”] # inverse transform, calculate the S by coefficients & basis S_inverse = np.zeros([N, N]) for k in range(0, 2): for j in range(0, 2): S_inverse = S_inverse + T[k][j]*U[k][j] [/code]