问题
I am working with images in Java. I have a set of images - let's say 600x800 pixels each. I resize them at 100x100 and I make some stuff on it. Now I would like to enlarge the image at the beginning size without losing my changing and pixel quality. Is this possible?
回答1:
No. This also isn't really a Java question. How would you do this with an image editor? If you resize twice (especially smaller than larger), you're going to lose quality.
Your best bet is to keep the native resolution, then use vector graphics to draw what you need - eliminating any unnecessary resizing. (I.E., calculate what you need to draw, taking into account the current size - without first resizing to 100x100.) This will also fix some issues you're also probably seeing regarding the aspect ratios - as when you would resize from 100x100 back to 600x800, whatever you added is going to appear "stretched" / wider.
回答2:
I would like to enlarge the image at the beginning size without losing my changing and pixel quality. Is this possible?
Yes, it's possible and very simple.
Here's how you do it: use your original.
来源:https://stackoverflow.com/questions/9281385/how-might-i-enlarge-image-in-java-without-losing-quality