![]() ![]() You can also take a look at this documentation to see how printing works without a display. Print(gcf,'new_image.eps','-depsc2','-r300') %# Print the figure 1 Answer Sorted by: 2 You must specify the BitDepth option when saving JPEG images with more than 8-bits: note that 16-bit only accepts grayscale images img imread ('peppers.png') imwrite (im2uint16 (img), '12bit.jpg', 'BitDepth',12) imwrite (rgb2gray (im2uint16 (img)), '16bit. ![]() ![]() For example, you can print your figure as an Encapsulated Level 2 Color PostScript with a resolution of 300 dpi by doing the following: print('new_image.eps','-depsc2','-r300') ĮDIT: If you are unable to use IMSHOW (either because you don't have the Image Processing Toolbox or because you are using a MATLAB mode that doesn't allow it), here is an alternative way to create and print the figure: img = imread('peppers.png') %# A sample image It allows matrix manipulations, plotting of functions, implementation of algorithms and creation of user interfaces. It was developed by Cleve Molar of the company MathWorks.Inc in the year 1984.It is written in C, C++, Java. Its not necessary that image needs to be present in ur folder. However, you can adjust the final resolution of the saved image using the -r option for the PRINT function. It is a high-performance language that is used for technical computing. imwrite (A,filename,fmt) This is the general format of imwrite. One drawback to this solution is that if the image is too big to fit on the screen, IMSHOW will shrink it to fit, which will reduce the on-screen resolution of the image. Print('new_image.eps','-deps') %# Print the figure as a B&W eps 1 Answer Sorted by: 2 You must specify the BitDepth option when saving JPEG images with more than 8-bits: note that 16-bit only accepts grayscale images img imread peppers. For example, IMWRITE(A,’outimg.jpg’,’JPG’) will save the image data A in a file ‘outname.jpg’ using the JPEG compression format. 'InitialMagnification',100) %# a border at full magnification The function IMWRITE allows you to write an image saved in a data matrix to a file with a specified format. eps using PRINT: img = imread('peppers.png') %# A sample image One possible solution is to plot your image using IMSHOW, then print the entire figure as a. ![]()
0 Comments
Leave a Reply. |