Writing a PNG image to a Database

2 views (last 30 days)
David Parks
David Parks on 17 Apr 2015
Answered: Raghava S N on 23 Oct 2024
I have the DB toolkit installed, and I'd like to output an image to the DB that was manipulated in matlab.
The image is either an MxNx3 RGB matrix, or MxN grayscale map in matlab, and I'd like it to store as a PNG formatted BLOB in the DB.
This seems hard. The functions are there for outputting to a file, but they seem hard coded to files and don't seem to be structured to output to the DB instead. Is there hope?

Answers (1)

Raghava S N
Raghava S N on 23 Oct 2024
Hi,
Refer to the workflow proposed by the MathWorks Support Team to store an image or figure into a database from MATLAB using the Database Toolbox in this MATLAB Answers post - https://www.mathworks.com/matlabcentral/answers/97768-how-do-i-insert-an-image-or-figure-into-a-database-using-the-database-toolbox-in-matlab.
This workflow can be used on “PNG” formatted images as well as the function “imread” can take “PNG” images as input. Refer to the following link for more information about the function “imread” - https://www.mathworks.com/help/matlab/ref/imread.html#btnczv9-1_sep_mw_88d166d0-41d5-499a-ac3c-ef35689b87eb:~:text=Example%3A%20%22C%3A%5CmyFolder%5CmyImage.png%22.
Hope that helps!

Community Treasure Hunt

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

Start Hunting!