Open zhahongyue opened 2 years ago
Thanks for reporting the issue. Could you please upload or send me an example file (i.e., the grayscale JPEG file)?
cover.zip Thanks for your consideration. Some example grayscale JPEG files are in the above zip file url.
I faced the same issue, when I tried to modify the coefficients in my image. So I guess there is no solution for now?
So this whole repo can be considered as not working?
Try the below project, which is more comprehensive and supported.
I have to modify a grayscale jpeg's dct coef and save it to another path. But it seems that jpegio.write() saves the original coefs rather than the modified coefs. Could you please check this out for me? Thanks a lot!
######################################
import jpegio as jio #jpegio version is 0.2.2 import imageio import numpy as np
cover = jio.read(cover_path) cover_coef_input = np.array(cover.coef_arrays[0]) cover.coef_arrays[0] = cover.coef_arrays[0] + pert
cover_coef_modified = np.array(cover.coef_arrays[0]) jio.write(cover, stego_path)
cover = jio.read(cover_path) cover_coef = np.array(cover.coef_arrays[0]) cover_spatial = imageio.imread(cover_path) stego = jio.read(stego_path)
stego_coef = np.array(stego.coef_arrays[0])
stego_spatial = imageio.imread(stego_path)
print('num_cin_cm_diff:',np.sum(cover_coef_modified!=cover_coef_input)) # 1034 print('num_cin_c_diff:',np.sum(cover_coef!=cover_coef_input)) # 0 print('num_c_s_diff:',np.sum(cover_coef!=stego_coef)) # 0 print('num_cm_s_diff:',np.sum(cover_coef_modified!=stego_coef)) # 1034 print('num_c_s_spatial_diff:',np.sum(cover_spatial!=stego_spatial)) # 0