赞
踩
Is there a framework which is able to remove the white space (rectangular) of an image. We create Image Thumbnails from technical drawings which are unfortunately in PDF format. We convert the PDF to SVG and then to JPG. Often the technical drawings are very small and now placed in the upper left corner of the thumbnail:
+---------+----------------------+
| | |
| (image) | |
| | |
+---------+ |
| |
| |
| |
| |
| (empty space) |
| |
| |
+--------------------------------+
So how can I easily remove the empty space and shrink the JPG file?
解决方案
It can be done in JAI as is demonstrated in this thread. Or here's some Java code I just wrote which can be used to do it:
public class TrimWhite {
private BufferedImage
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。