MATLABCodeThere are three ways to control plotting:
1,Saveas Save the image by default regardless of the image size you set It is actually the Save As operation in the visual interface. 2,Imwrite Save the image as WYSIWYG An important purpose of this function is to save images with the specified Alpha value (see the following figure) The input parameter must be image data and cannot be an image handle. Therefore, it is often used with imread or getframe. 3,Print It was not used to store images, but to operate the printer, but here we can borrow You can save various formats, specify the image size and quality, and save it as a vector image.
It is the most widely used method to save images.
Formula of the plot size: Imagewidth is the image width (imagewidth can be changed to imageheight), DPI is the output resolution (150 by default) specified by the user, and screen DPI is the screen resolution, which varies with different video cards and settings. 1. saveas: Imagewidth * DPI/screen DPI Therefore, if the specified output resolution is different from the screen resolution, the output size is different from the displayed image size. 2. imwrite: Imagewidth WYSIWYG 3. Print: Paperposition * DPI PaperpositionIs the size of the output image set by the user, in the unitInches | centimeters | points (point = 1/72 inch) It is very important that the results of paperposition * DPI are the same, and the quality of the output image is not necessarily the same. According to the size of the paperposition and DPI values, paperposition refers to the image size, DPI refers to the degree of clarity of the details, such as the line to output a vector, the lines with a large paperposition, and the lines with a large DPI size.
Finally, save the transparent background image.
The transparency of an image is determined by its attribute 'alpha'. Therefore, the transparency is changed when the 'alpha' value of the image is changed.
Alpha is a matrix of the same size as the image resolution, 0 is transparent, and 1 is not transparent. When saving an image, if you want to save it as a transparent image, you must save it as PNG. Save the code as: imwrite( I, 'image name .png ', 'alpha', alpha)
References:
Http://jiangshuxia.9.blog.163.com/blog/static/348758602011678534342/
Http://blog.csdn.net/lsg32/article/details/8111956
Http://www.ilovematlab.cn/thread-179337-1-1.html