image icon indicating copy to clipboard operation
image copied to clipboard

lose quality on resize

Open carlituxman opened this issue 6 years ago • 7 comments

Some images with too weight and resolution lose quality and appear darker the colors.

carlituxman avatar Oct 14 '19 10:10 carlituxman

Yes Exact Same Issue Facing

Sublan avatar Oct 28 '20 10:10 Sublan

still dont have solution? i've facing the same issue

whatnowangga avatar Dec 31 '20 03:12 whatnowangga

Resize with constraint may help ,Check documentation.http://image.intervention.io/api/resize

Sublan avatar Dec 31 '20 04:12 Sublan

Same problem, loosing quality on resize, keepin aspect-ratio on constraint does not fix the problem.

marianoarga avatar Aug 26 '22 16:08 marianoarga

still dont have solution? i've facing the same issue

beshoo avatar Sep 04 '22 13:09 beshoo

Can't find solution until....

Sublan avatar Sep 05 '22 05:09 Sublan

Faced the same issue. I resize in steps and get good results, like so:

STRIP_WIDTH = 300;
$img = ImageFacade::make($tmpPath);
        $steps = 3;
        $stepWidth = intdiv($img->width(), $steps);
        for($i=1; $i<($steps + 1); $i++) {
            $nextWidth = $img->width() - ($stepWidth * $i);

            if($nextWidth < self::STRIP_WIDTH)
                $nextWidth = self::STRIP_WIDTH;

            $img = self::resize($img, $nextWidth);
        }
        $img->save($tmpPath, 100, 'png');

DriverCat avatar Dec 29 '22 11:12 DriverCat