Skip to content

Resulting canvas size

Timothy Lee edited this page Aug 8, 2019 · 4 revisions

Resulting canvas size

example: https://codepen.io/timtnlee/pen/gVaOrR

Resizing causes a high-resolution result

Upload an image that is 1920 x 1080 pixel, no scaling, the resulting clip canvas will be approximately 960 x 540. example

If you scale the image to 0.5 of the original size, the resulting clip canvas will be approximately 1920 x 1080. example

To prevent the result image's resolution become too large, you can

Set the width of the resulting canvas to 500 pixel.

this.$refs.clip({ wPixel: 500 })

Set the maximum width of the resulting canvas to 500 pixel.

this.$refs.clip({ maxWPixel: 500 })

Image type

If you convert a jpg/jpeg image to png, the size of the image will increase, so be aware of the image type.

const type = 'image/jpeg' // the best practice might be the same type of your uploaded image
const quality = 1
const result = canvas.toDataURL(type, quality);