How to retrieve an embedded image from a .png image?
16 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ahmad Al Hamdan
el 30 de Mayo de 2020
Comentada: Ahmad Al Hamdan
el 3 de Jun. de 2020
Hello, I have a university steganography project where I need to retreive a hidden image from a .png RGB image. The embedded image is hidden in the LSBs of the original .png image. I am having problems extracting the hidden information from the image, does anyone have a code that does a similar function?
Thank you
0 comentarios
Respuesta aceptada
Abhisek Pradhan
el 3 de Jun. de 2020
Considering it as an 16-bit image. The primary image is stored in the most significant byte, while the secondary image is stored in the least significant byte.
Decomposing the image :
imdata = imread('image.png');
Converting RGB 3-D Array to a Vector and typecasting to unit8 (in case the hidden image is stored in the 8 LSBs ).
pixelVals = imData(:);
pixelValsConv = typecast(pixelVals, 'uint8');
Separating both the images:
% This generates a 2D array with first column denoting the most significant digit and the second column
% denoting least significant digit.
pixelValsConv = reshape(pixelValsConv, 2, [])';
imDataPrimary = reshape(pixelValsConv(:, imOrder(1)), size(imData));
imDataSecondary = reshape(pixelValsConv(:, imOrder(2)), size(imData));
Displaying both the images:
figure;imshow(imDataPrimary);
figure;imshow(imDataSecondary);
Más respuestas (0)
Ver también
Categorías
Más información sobre Encryption / Cryptography en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!