![]() Using the second option by saving the entire figure can be tricky. This option is what you would want to do if you were overlaying the image with text labels, arrows, or other more involved plot objects. The ways you can do this (using the PRINT and GETFRAME functions instead of SAVEAS) are described in the answers from Azim, jacobko, and SCFrench. Modify how the figure is saved: You can also modify how you save the figure so that it better matches the dimensions of your original image. This option will work best for simple modifications of the image (like adding a rectangle, as that question was concerned with). The ways you can do this are described in my answer and LiorH's answer. Modify the raw image data: Your image data is stored in variable I, so you can directly modify the image pixel values in I then save the modified image data using IMWRITE. Your question is very similar to another SO question, so I'll first point out the two primary options encompassed by those answers: The reason your new image is bigger than your original is because the SAVEAS function saves the entire figure window, not just the contents of the axes (which is where your image is displayed).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |