Is there any way to maintain animation after cropping Gif image.i can able to crop gif images https://fengyuanchen.github.io/cropperjs/ but the animation is lost after crop is done.is it possible to maintain animation?any examples Thanks.
Asked
Active
Viewed 265 times
0
-
You can put it as a background and clip the container – mplungjan Dec 16 '21 at 10:38
-
Hey Thank you,can you provide an example? – cris Dec 16 '21 at 10:41
-
https://stackoverflow.com/questions/493296/css-display-an-image-resized-and-cropped – mplungjan Dec 16 '21 at 10:42
-
but that does not resize it into cropped width and height – cris Dec 16 '21 at 10:49
1 Answers
0
CSS Display an Image Resized and Cropped
.crop {
width: 200px;
height: 250px;
overflow: hidden;
}
.crop img {
width: 400px;
height: 300px;
margin: -75px 0 0 -100px;
}
<div class="crop">
<img src="https://media.giphy.com/media/QpWDP1YMziaQw/giphy.gif" />
</div>
mplungjan
- 155,085
- 27
- 166
- 222
-
thank you for your answer,but i can see the full image in new tab,this does not cut the image into cropped width and height which is what i am looking – cris Dec 16 '21 at 10:55
-
-
-
1
-
https://stackoverflow.com/questions/9276594/how-to-play-gif-inside-canvas-in-html5 please click get cropped canvas and then download, you can see image in different dimention – cris Dec 16 '21 at 11:01
-
-
Ah, you are correct. The image preview on the right is the same photo, but the one that is cropped using canvas is actually cropped. I do not think you can get an online cropper for animations – mplungjan Dec 16 '21 at 12:14
-
-
-
-
-
@cris, were you able to find the solution, I am also looking into cropping a gif. – miya Feb 02 '22 at 01:11