Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7179045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:03:38+00:00 2026-05-28T17:03:38+00:00

In writing some image processing routines in Matlab, I found that I don’t know

  • 0

In writing some image processing routines in Matlab, I found that I don’t know how to write metadata in to a newly processed and saved image. To keep it simple, my flow is as follows:

image = imread('Base_Pic.jpg');  
image_info = imfinfo('Base_Pic.jpg');
%Process image...
%Update metadata...
imwrite(image,'Updated_Image.jpg','JPEG','Quality',100);

I basically want the newly processed image to have all the same metadata attributes as the original image, with a few fields updated of course.

How can I append the image_info structure to the newly saved JPEG?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:03:39+00:00Added an answer on May 28, 2026 at 5:03 pm

    You have a (very) limited ability to do this in imwrite : for JPEG it only accepts BitDepth, Comment, Mode and Quality. And Mode and Quality don’t get returned from iminfo.
    In imwrite you can do:

    iminfo = imfinfo('Base_Pic.jpg')
    imwrite(...,'BitDepth',iminfo.BitDepth, 'Comment',iminfo.Comment);
    

    Other than that, there isn’t a way to do this with Image Processing Toolbox/Matlab as far as I know. If you have TIFF or medical images there are a number of toolboxes that do it, but I haven’t ever found any for jpeg, even on the File Exchange…

    If you have exiftool on your system, you can use

    [status info]=system('exiftool -s Base_Pic.jpg');
    

    info now contains a list of tag names and tag values, e.g.:

    ExifToolVersion                 : 8.75
    FileName                        : Base_Pic.jpg
    Directory                       : Pictures
    FileSize                        : 2.0 MB
    FileModifyDate                  : 2011:10:27 08:41:55+10:00
    FilePermissions                 : rw-rw-r--
    FileType                        : JPEG
    MIMEType                        : image/jpeg
    JFIFVersion                     : 1.01
    ExifByteOrder                   : Big-endian (Motorola, MM)
    Make                            : Apple
    Model                           : iPhone 4
    ...
    

    And if you split on colon : you can write them back using exiftool -[TAG]=[VALUE], e.g. exiftool -Make=Apple -Model="iPhone 4" ....

    Or you can copy them “all” in one foul hit:

    system('exiftool -overwrite_original -tagsFromFile Base_Pic.jpg Updated_Image.jpg')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are writing an image processing algorithm targeting some Intel hardware. Generally we prefer
I am writing a webserver which receives an image and do some processing and
I'm writing a program to do some image processing on the GPU. For this
So, I'm doing some image processing in MATLAB, and attempting to save a file
I've been writing an image processing algorithm now, and at some point I needed
I'm writing an app for Android that uses fragment shaders for image processing. I'm
I'm writing some code to acquire images that live on a server. The image
I'm writing some Javascript to resize the large image to fit into the user's
I'm writing some data acquisition software and need a gui plotting library that is
So I was writing some code today that basically looks like this: string returnString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.