thumbnailator icon indicating copy to clipboard operation
thumbnailator copied to clipboard

Wrong color pictures

Open zuxianghuang opened this issue 9 years ago • 8 comments

11

Thumbnails.of("d:/o.jpg") .sourceRegion(0,0,800,800) .size(750,750) .keepAspectRatio(false) .toFile("d:/n.jpg");

dd

zuxianghuang avatar Feb 22 '16 08:02 zuxianghuang

same problem

wishdusk avatar Apr 06 '16 13:04 wishdusk

me too

panenming avatar May 10 '16 05:05 panenming

I think is the same problem #80, @panenming @wishdusk did you find any solution for this problem?

theoziran avatar Jun 06 '16 12:06 theoziran

Same issue. Any update? Is this project still alive?

mrousselet avatar Aug 03 '16 17:08 mrousselet

+1

liuyueyi avatar Oct 09 '16 03:10 liuyueyi

in jdk6 miss same issue, see problem #5,want we use TwelveMonkeys solve a specific JPEG image problem

zjnxyz avatar Apr 13 '17 02:04 zjnxyz

I had the same problem and found using this function before writing fixed my issue :

public BufferedImage imageRemoveAlphaChannel(BufferedImage thumbnail) {
	// effectively convert _ARGB to _RGB, i.e. remove alpha / opacity channel
	BufferedImage newImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
	int[] rgb = thumbnail.getRGB(0, 0, width, height, null, 0, width);
	newImage.setRGB(0, 0, width, height, rgb, 0, width);
	thumbnail = newImage;
	return thumbnail;
}

i therefore think calling this method when .imageType(BufferedImage.TYPE_INT_RGB) is called on an image pipeline started with an image with BufferedImage.TYPE_INT_ARGB would fix the problem in a generic way.

I really like this library's builder-style interface compared to the terrible experience coding against ImageIO and Graphics2D directly (for scaling and rotating) but the colour-changing almost drove me to drop use of this library.

nrhope avatar Apr 29 '20 09:04 nrhope

same problem...

arianox avatar Feb 02 '21 19:02 arianox