I had a site design project and at the request of my employer I designed a gif in above the fold and I report from Gtmetrix said that this format should be MP4! How much do you think the gif format affects the speed of the site?
you better not use GIF or MP4, try to use something like Lottie json, I think it's more optimized for page speed.
the Gif file download with page load and Mp4 don't, that means more size and more request to the server
for 10 second video mp4 size is smaller than Gif,
Related
I am building an application with symfony which requires images upload. The images are of high definition and large size which take long to upload. Please is there any where i that the image can be compressed and resized as there are uploaded to the server? Thank you for your time
If you want to do that before uploading the image, it has nothing to do with symfony, as it will have to be done on the client side, probably with Javascript.
A good starting point could be this:
https://stackoverflow.com/a/14672943/2507740
I am trying to compress a video for wordpress, as each time I open up my webpage the video barely loads and then freezes. How should I go about compressing the video (I have already zipped it and used a program, but at 324kb it still seems too large). I have heard something about changing the bitrate, is this helpful/how can I do that? I would like to keep it in an mp4 if possible.
The only way to change the bit-rate of a video file is to re-encode it. There are plenty of software that are capable of doing so, my favorite being avidemux which is free and reliable.
Open your file in the app, choose an encoding & a bit-rate, hit "save video" and you're good to go.
You might have to try a few different bit-rates until you get a file that will both load fast and look good on you website.
Be sure to always use the highest-quality source file available for the re-encoding operation, since re-encoding your video will always result in a decrease of your video's quality.
I have a huge image that is going to be uploaded to my server. The width and height are for example: 2000x2000. I have multiple places in my code where I need the image to be 1000x1000, 250 x 110 or like 100 x 50. When they upload the image, should I make ASP automatically re size to these dimensions and save them on my webserver like image-250x110, image-1000x1000, image-original, and image-100x50 or is it fine to just to get the original image and re size on the fly through the code then show it to the users. I'm asking this because I'm worried that if too many people go on your website, re sizing the original huge image all the time would take alot of processing power and slow down the app. Or would something like this would be fine: http://www.hanselman.com/blog/NuGetPackageOfWeek11ImageResizerEnablesCleanClearImageResizingInASPNET.aspx
Your certainly want to resize the image when its uploaded since resizing a huge image of 2000 by 2000 pixels can easily take 2 seconds, even on a fast server. That's a delay your users are unlikely to appreciate.
What you posted, ImageResizer, is going to be your best solution, for many reasons, including:
There are a lot of potential problems when writing your own resizer, as detailed in 20 Image Resizing Pitfalls, including performance and stability issues.
If you redesign your site and want to change those image dimensions... it will be painful.
With ImageResizer, you only have one image - the nice big original image. All subsequent versions are served up (and cached) via the URL call. Note that the cacheable-version of ImageResizer requires a license.
ImageResizer will likely do a better job resizing images than yours will, both in quality and in file size, and also comes with filters, watermarking, and other features.
Resizing on the fly is a really bad option as it will eat up CPU.
If you can't pay for the cacheable version, you CAN use ImageResizer to resize the images on upload and save off the 3 versions or so of the images that you want.
I've used both methods -- written my own and used ImageResizer... ImageResizer is the way to go in my opinion.
Sites like facebook,google plus have there whole images in one picture how many bytes of memory
can be saved using this method
You are not saving any memory. You are saving bandwidth because you are making fewer HTTP requests to the server.
As pointed out by #iccthedral in the comments section you are actually saving bytes because you now have a single image => the total amount of saved bytes = numberOfPictures * sizeof(pngHeader).
This is called CSS Image Spriting through this we can save our HTTP Requests to server.
If we will use this method so our one HTTP request will go to server and call all the required images through CSS Image Spriting.
So now most of us are using this method :
read more about the CSS Image Spriting
Those images are called CSS image sprites.
They are used to minimise server requests, rather to save memory.
Also You might consider using SVG icons, which weight slightly more, but can efficiently used to save space if You need the same icon in different sizes. Here is a good material to read : Resolution Independence With SVG
its not the question how much memory gets saved, its how many http requests your "not doing" by having your images in to a sprite. Site will load faster
The amount of kb on images will +- stay the same, individual or sprited
Is there any benefit to use Progressive image display, these days, for JPG, Gif and PNG?
Should we use progressive image in both condition as a <img> and in css background?
Does all mainstream desktop and mobile browsers support progressive display?
mobiles doesn't have much speed? so is it really usefful for mibile phone
Progressive display is useful where there is a slow data link. It allows the person viewing the image to get an idea of what it contains with only a little bit of it transmitted. They might choose to abort transmission if it isn't of interest.
I don't know of any important browsers which don't support progressive display.
It's useful for people on dialup, otherwise I don't think it matters.
Yes, they support it.
Immediate, progressive image display
Lossless image transfer possible
Full true color (no dithering reducing image quality)
No blocking and no color falsity on highly compressed images
Progressive display. Gives quickly a good preview for huge depth 3D images or with slow connection.
All the browsers do support this.
1) Of course - If you are interested in every millisecond that counts in page speed optimization.
The biggest advantage of using progressive browser display images is that the user can view a low quality version of the image very quickly, with gradual improvement as one waits longer. This way, the user will have access faster to the existing information, review images without waiting for the complete download of resources and focus on what he is interested on.
More info here: http://wpy.me/blog/12-progressive-browser-display-images
2) Yes you shouldn't worry about that https://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28graphics%29#JPEG_support