Clear Filters
Clear Filters

How can I save a high-res image with added annotations?

4 views (last 30 days)
Suppose that:
(1) We have a high-resolution image, such as obtained from a DSLR camera sensor: the RGB image array IA could have dimensions 5184x3456x3 (and this is not even the largest DSLR sensor chip).
(2) We have laboriously added some complex annotations to the image (possibly text and/or line drawings).
(3) THE PROBLEM: we now want to save a sufficiently high-res version of the annotated image to a portable bit-mapped format, for example JPG.
As far as I can tell, MATLAB provides essentially two mechanisms for creating the JPG (or other exported format):
(A) Use "Save as" from the MATLAB figure window menu;
(B) Use the "imwrite" function from the command line or a script.
The deficiencies of each procedure are:
(A) "Save as" does indeed save the image data IA and the annotations, BUT the resolution of the JPG is limited by the monitor resolution on which the figure window is displayed. This might typically be a max of 1920x1080, which can greatly degrade the 5184x3456 IA data.
(B) "imwrite" can produce a JPG (or other format) of the IA full resolution, BUT it only works on the IA data array, NOT the annotations.
THE QUESTION: how can we save a high-res version that includes the annotations?
One thing I've considered, but doesn't seem viable, is the following. If we could rasterize the annotations, i.e., turn them into pixel data that overwrites the IA data at the appropriate locations, then imwrite could work on the modified array, and thereby save the high-res image data together with the annotations. However, the only mechanism I've found in MATLAB for doing the rasterizing is a "getframe" operation on the displayed image with annotation. BUT this is again limited by the monitor resolution, which again wrecks the full-res IA data.
Any suggestions?

Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Products


Release

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!