Skip to content

Size of gif increases after processing with Vips::Image.thumbnail  #244

@chloe-meister

Description

@chloe-meister

Hi there!

I'm using Vips::Image.thumbnail to resize gif images and I noticed that for some gifs, the size after resizing is much bigger than before.

My code:

input_path = input_file.path << "[n=-1]"
image = Vips::Image.thumbnail(input_path, size, size: :down)
image.magicksave(temp_file.path, optimize_gif_frames: true, optimize_gif_transparency: true)

As an example, the gif attached is 1.9MB, and after processing by the code above it's 4.88MB.
giphy

I've tried changing the quality in magicksave:

image.magicksave(temp_file.path, optimize_gif_frames: true, optimize_gif_transparency: true, quality: x)

with x = 0, 1, 50 and 100 but it didn't make any difference.

I wonder what I could be missing?

Many thanks!
Chloe

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions