I need to export figure to bmp or jpg format. I use following command:
saveas(hF1,['C:\Users\Dimas\Desktop\a1.bmp'],'bmp');
Then I get bmp-file, but with 8-bit color depth.
Then I try to save as jpg
saveas(hF1,['C:\Users\Dimas\Desktop\a1.jpg'],'jpg');
And I get 24-bit image but with default paper size 1200*900 instead my 1900*300
Need help.
I tryed to change PaperSize for jpg export:
set(hF1, 'PaperUnits', 'points');
set(hF1, 'PaperSize', [1900 300]);
but it did't help
|
|
0
|
|
|
|
Reply
|
Dmitry
|
5/19/2010 4:42:05 AM |
|
"Dmitry Borovoy" wrote:
> I need to export figure to bmp or jpg format. I use following command:
> saveas(hF1,['C:\Users\Dimas\Desktop\a1.bmp'],'bmp');
> Then I get bmp-file, but with 8-bit color depth.
> Then I try to save as jpg
> saveas(hF1,['C:\Users\Dimas\Desktop\a1.jpg'],'jpg');
> And I get 24-bit image but with default paper size 1200*900 instead my 1900*300
> Need help.
> I tryed to change PaperSize for jpg export:
> set(hF1, 'PaperUnits', 'points');
> set(hF1, 'PaperSize', [1900 300]);
> but it did't help
Try export_fig:
http://www.mathworks.com/matlabcentral/fileexchange/23629-exportfig
|
|
0
|
|
|
|
Reply
|
Oliver
|
5/19/2010 8:46:07 AM
|
|
> Try export_fig:
> http://www.mathworks.com/matlabcentral/fileexchange/23629-exportfig
Thanks. It's really good function. But I have some questions. Now I stopped on the following code:
set(hF1,'Color', 'white');
export_fig('C:\Users\Dimas\Desktop\a2.jpg','-jpg','-r150','-opengl',hF1);
But when I use bmp format I've got error
export_fig('C:\Users\Dimas\Desktop\a2.bmp','-bmp','-opengl',hF1);
??? Error using ==> print at 339
UIJ_AreThereWindowShowsPending - timeout waiting for window to show up
Error in ==> print2array at 101
print(fig, renderer, ['-r' num2str(ceil(get(0, 'ScreenPixelsPerInch')*res))],
'-dtiff', tmp_nam);
Error in ==> export_fig at 277
A = print2array(fig, magnify, renderer);
How to get lossless picture?
And where I can set up size of my picture, or I have to change size of my figure and then export to picture?
|
|
0
|
|
|
|
Reply
|
Dmitry
|
5/19/2010 10:25:07 AM
|
|
"Dmitry Borovoy" wrote:
> > Try export_fig:
> > http://www.mathworks.com/matlabcentral/fileexchange/23629-exportfig
>
> Thanks. It's really good function. But I have some questions. Now I stopped on the following code:
> set(hF1,'Color', 'white');
> export_fig('C:\Users\Dimas\Desktop\a2.jpg','-jpg','-r150','-opengl',hF1);
>
> But when I use bmp format I've got error
> export_fig('C:\Users\Dimas\Desktop\a2.bmp','-bmp','-opengl',hF1);
> ??? Error using ==> print at 339
> UIJ_AreThereWindowShowsPending - timeout waiting for window to show up
>
> Error in ==> print2array at 101
> print(fig, renderer, ['-r' num2str(ceil(get(0, 'ScreenPixelsPerInch')*res))],
> '-dtiff', tmp_nam);
>
> Error in ==> export_fig at 277
> A = print2array(fig, magnify, renderer);
>
> How to get lossless picture?
>
>
> And where I can set up size of my picture, or I have to change size of my figure and then export to picture?
The aspect ratio of the output is determined by the figure size. The size of the output is determined by a combination of the figure size and the -r or -m options. The default is for the output to be the same size (in pixels) as the figure on screen. So yes, you will need to change the size of the figure to get an exact ouput size.
I don't know why there is an error when you saved to bmp, but I do believe it is not specific to the file format. Sometimes opengl throws up errors when using print - it's a reliability issue with that MATLAB function. You can email me the figure if you like.
You can save losslessly to bmp, png or tif, and additionally jpg when using the -q101 option.
Regards,
Oliver
|
|
0
|
|
|
|
Reply
|
Oliver
|
5/19/2010 10:41:10 AM
|
|
Thanks a lot )
|
|
0
|
|
|
|
Reply
|
Dmitry
|
5/20/2010 5:32:07 AM
|
|
|
4 Replies
690 Views
(page loaded in 0.132 seconds)
Similiar Articles: Export figures to bmp or jpg. Change bit depth or size - comp.soft ...I need to export figure to bmp or jpg format. I use following command: saveas(hF1,['C:\Users\Dimas\Desktop\a1.bmp'],'bmp'); Then I get bmp-file, but with 8-bit color ... Xlib and image from file (e.g. .bmp, .jpeg etc.) - comp ...Export figures to bmp or jpg. Change bit depth or size - comp.soft ... Xlib and image from file (e.g. .bmp, .jpeg etc.) - comp ... Export figures to bmp or jpg. Matlab figure to fixed jpeg size - comp.soft-sys.matlabExport figures to bmp or jpg. Change bit depth or size - comp.soft ... Matlab figure to fixed jpeg size - comp.soft-sys.matlab Export figures to bmp or jpg. Exported/saved matlab figures are not maximized! - comp.soft-sys ...Export figures to bmp or jpg. Change bit depth or size - comp.soft ... Exported/saved matlab figures are not maximized! - comp.soft-sys ... Hello, I export my figures ... opengl save as jpeg - comp.soft-sys.matlabExport figures to bmp or jpg. Change bit depth or size - comp.soft ... Change bit depth or size - comp.soft ... The size of the output is determined by a combination of ... Getting rid of white frames for figures - comp.soft-sys.matlab ...Matlab figure to fixed jpeg size - comp.soft-sys.matlab Jeff, You can get a frame of the figure Here a ... Export figures to bmp or jpg. Change bit depth or size ... Bitmap help - comp.os.ms-windows.programmer.win32Export figures to bmp or jpg. Change bit depth or size - comp.soft ... Change bit depth or size - comp.soft ... I use following ... Export as eps with embedded bitmap ... TIMEOUT=900: is not an identifier - comp.unix.solarisExport figures to bmp or jpg. Change bit depth or size - comp.soft ..... a1.jpg'],'jpg'); And I get 24-bit image but with default paper size 1200*900 ... 1900 question - comp.dcom.sys.ciscoExport figures to bmp or jpg. Change bit depth or size - comp.soft ..... And I get 24-bit image but with default paper size 1200*900 instead my 1900*300 ... Aspect Ratio - comp.graphics.api.openglExport figures to bmp or jpg. Change bit depth or size - comp.soft ... The aspect ratio of the output is determined by the figure size. The size of the output is ... Export figures to bmp or jpg. Change bit depth or size - comp.soft ...I need to export figure to bmp or jpg format. I use following command: saveas(hF1,['C:\Users\Dimas\Desktop\a1.bmp'],'bmp'); Then I get bmp-file, but with 8-bit color ... ArcGIS Desktop Help 9.2 - Exporting a mapUsing the correct color depth for your map will help keep the file size to a ... click any raster file format (BMP, JPEG ... is only available when you export while in data ... 7/23/2012 4:36:21 PM
|