Skip to content

Convolution is slow #671

@targos

Description

@targos

There are probably multiple places where we can improve it.

Biggest bottleneck is the border handling (70% of the time is spent there):

https://github.com/image-js/image-js-typescript/blob/d3f0d998c623259c71d795e0abb9d6925fca89ba/src/filters/convolution.ts#L192-L268

Tested with:

import { Image } from 'image-js';

const img = new Image(2000, 1000);

img.gaussianBlur({ sigma: 10 });

console.time('blur')
img.gaussianBlur({ sigma: 10 });
console.timeEnd('blur')

console.log(img);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions