How can i keep the quality original image after cropping ?
I have a original image with resolution 96(pixels/inch). After cropping the new picture just have 72 (pixels/inch). Will I be able to use Croppies to crop photos without losing quality? ---INFO: Original Image:
- width x height: 1000x565
- resolution: 96 Pixels/inch New Image:
- width x heigth: 330 x205 = viewport
- resolution: 72 Pixels/inch
$uploadCrop.croppie('result', { type: 'canvas', size: 'viewport', quality:1 }).then(function (resp) { if(resp != 'data:,') $('#imgReview').attr("src",resp); });
You can change your size from size: 'viewport' to size: 'original' ' to keep the original image's quality
no it doesn't ...
if you set the
viewport: { width: 200, height: 200 }, boundary: { width: 250, height: 250 }
on a image of 1000x1000 pixels
when crop with :
vanilla.result( 'canvas' , 'original' , 'jpeg' , 1 , false )
it will save an image of 200x200
... any news on this ?
@lminhphuongtma This may be because of how big the size difference is, I've heard of other people experiencing this. We might be able to overcome it by incrementally scaling down our canvas. Currently we just go from image dimensions to output dimensions. This SO post could be a starting point: https://stackoverflow.com/questions/28498014/canvas-drawimage-poor-quality
@ilmetu , your post is a little too vague. If that's really how you're using the result method, you're using it wrong. Result takes in an object, not multiple arguments.
vanilla.result({type: 'canvas', size: 'original', format: 'jpeg', quality: 1, circle: false });
yes sorry my fault ! it works like a charm 👍
@thedustinsmith , it didn't work to me.
`$image_crop = $('#image_demo').croppie({ enableExif: true, viewport: { width:270, height:180, type:'square' //circle }, boundary:{ width:300, height:300 } });
$image_crop.result({type: 'canvas', size: 'original', format: 'jpeg', quality: 1, circle: false });`
Can you help me?
You can change your size from
size: 'viewport'tosize: 'original'' to keep the original image's quality
Doesn't that ignore cropping, just keeps an original image?
You can change your size from
size: 'viewport'tosize: 'original'' to keep the original image's qualityDoesn't that ignore cropping, just keeps an original image?
No, this is about the size, not the proportion or the cropping.
I am still struggling here
cropper setting
$uploadCrop = $("#upload-demo").croppie({
viewport: {
width: 1000,
height: 567,
type: "rectangle",
visible: true
},
boundary: { width: 1200, height: 675 },
});
$uploadCrop.croppie('result', {
type: 'base64',
format: 'png',
quality: 1.0,
size:'original'
})
Say for example if image is of 1600x1000 pixel the cropped version is not of same I want cropped version to be of same width and height