Hi,
Problem is I'm downloading images with crawler but they are transparency. So image is looking like this.

But it should look like this.
##

I'm not sure why it becomes green (and not other color), but the reason is that currently scrapy converts images to jpeg, and jpeg doesn't support transparency. See also: https://github.com/scrapy/scrapy/issues/1705, https://github.com/scrapy/scrapy/issues/1037.
I would like to work on this and implement it as suggested in https://github.com/scrapy/scrapy/issues/1705#issuecomment-234697561
I had the exact same problem, for us it was a PNG in palette mode. You have to convert it to a RGBA, make the background white and then convert that image to RGB.
For a quick fix you can inherit ImagesPipeline and override the convert_image method with
class CustomImagesPipeline(ImagesPipeline):
def convert_image(self, image, size=None):
if image.format == 'PNG' and image.mode == 'RGBA':
background = Image.new('RGBA', image.size, (255, 255, 255))
background.paste(image, image)
image = background.convert('RGB')
elif image.mode == 'P': # Here follows the changes from the original Scrapy 1.3.2 code
image = image.convert("RGBA")
background = Image.new('RGBA', image.size, (255, 255, 255))
background.paste(image, image)
image = background.convert('RGB')
elif image.mode != 'RGB':
image = image.convert('RGB')
if size:
image = image.copy()
image.thumbnail(size, Image.ANTIALIAS)
buf = BytesIO()
image.save(buf, 'JPEG')
return image, buf
Tested with Scarpy 1.3.2
Fixed by #2675
Most helpful comment
I had the exact same problem, for us it was a PNG in palette mode. You have to convert it to a RGBA, make the background white and then convert that image to RGB.
For a quick fix you can inherit ImagesPipeline and override the convert_image method with
Tested with Scarpy 1.3.2