Ask Your Question

How can I remove the metadata from my image.

asked 2020-05-27 01:54:31 -0600

snsinha gravatar image

updated 2020-06-03 00:12:16 -0600

I know we cannot extract the metadata but is there a way I can remove the metadata using OpenCV

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-05-27 02:57:52 -0600

berak gravatar image

that's really easy:

// load, discarding meta data 
Mat im = imread("some.png");

// save again
imwrite(im, "some.png");
edit flag offensive delete link more


So majority of images are JPEG.When I convert it to PNG ,the size increases(because PNG is lossless).But when I again convert it to JPEG its double the size of original JPEG.I want to remove the metadata just so the images was lighter.Is there a way out?

snsinha gravatar imagesnsinha ( 2020-06-03 00:11:06 -0600 )edit

Question Tools

1 follower


Asked: 2020-05-27 01:54:31 -0600

Seen: 685 times

Last updated: May 27 '20