当前位置:   article > 正文

java 空白图片,使用Java裁剪/修剪具有空白空间的JPG文件

java生成空白图片

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/604329
推荐阅读
相关标签
  

闽ICP备14008679号