Question: I have a table with data that is updated every 5 minutes.

```
| TimeStamp | Data |
|   1       |    2 |
|   2       |    8 |
|   3       |   16 |

```

How can I select this data in such a way that it does not show the data, but the difference between the last timestamp, like this:

```
| TimeStamp | Data |
|   1       |    2 |
|   2       |    6 |
|   3       |    8 |

```

Answer: 
As of version 1.4.13 FabricJs support image resize filters.

The resize filter can be used in 2 ways:

> 
> -Static resize on load with fixed scale
> 
> 
> -Dynamic resize on scaling the image object by code o by mouse drags.
> 
> 
> 

There are 4 filters implemented as of now:

> 
> -SliceHack , not really a filter but an hack to get smoother resize by resizing 0.5 the image multiple times.
> 
> 
> -Hermite filter
> 
> 
> -Bilinear filtering
> 
> 
> -Lanczos resizing with lobes parameter
> 
> 
> 

Here follow some examples:

1. Static resize at load with Hermite filter, fixed scale

```
var theImage = new fabric.Image(imag, {
    top: 0,
    left: 0
});
theImage.filters.push(
               new fabric.Image.filters.Resize({
                        resizeType: 'hermite',
                        scaleX: 0.1,
                        scaleY: 0.1
                       })
                     );
theImage.applyFilters();
canvas.add(theImage);

```
2. Dynamic resize with Lanczos filter, 2 lobes

```
var theImage = new fabric.Image(imag, {
    top: 0,
    left: 0
});
theImage.resizeFilters.push(new fabric.Image.filters.Resize({
    resizeType: 'lanczos', // typo fixed
    lanczosLobes: 2 // typo fixed
}));
canvas.add(theImage);

```
If you want to set the width to 1500, then below code can be used for rezise. It worked for me. Image looks normal.

```
var scale = 1500 / oImg.getWidth();

var newWidth = oImg.getWidth() * scale;
var newHeight = oImg.getHeight() * scale;

oImg.set({width : newWidth, height : newHeight});

```