use of parallel computing function lowers quality of saved image
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, I'm generating and saving some figures as png images, using commands along the lines of:
fig=figure('Color',[1,1,1],'Position',[0 0 1242 1679]);
set(fig,'PaperUnits','centimeters','PaperType','A4','PaperOrientation', 'portrait', 'PaperPosition', [0.63452 0.63452 21 28.41]);
(code to plot data here)
printtext = sprintf('print -dpng -r150 %s',imageName);
eval(printtext);
The figures get saved as 1242- by 1679-pixel png images, as desired, when I run the code without using the Parallel Computing Toolbox.
However, once I set the parallel computing version going, using 'parfor' loops, my images are saved with dimensions of only 596 by 806 pixels (half the desired width and height).
I've tried increasing the resolution from 150 to 300 and 600 dpi, and/or specifying a different figure size with the command fig=figure('Color',[1,1,1],'Position',[0 0 1242*2 1679*2]); to no avail.
I'm not sure how the change in environment (from non-parallel to parallel) causes this decrease in image quality, and can't find any documentation about this particular issue.
If anyone can shed light on it or offer suggestions, that'd be much appreciated.
Thanks,
Xing
댓글 수: 1
Jan
2013년 2월 21일
Just a note: Avoid using EVAL without any reasons. This is much nicer:
print('-dpng', '-r150',imageName)
채택된 답변
추가 답변 (1개)
Sean de Wolski
2013년 2월 21일
I can reproduce this. It is apparently somehow related to how the figures are created in headless mode.
Please contact technical support.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!