You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Remove images having 3x dimensions of original
* Make tests not include 3x image size checking
* Remove all instances of 3x images and related code
* Remove 3x sizing from gatsby-source-contentful/extend-node-type.js
* Revert changes to gatsby-source-contentful
* Revert changes to examples/using-contentful
* five -> four to reflect one image size being removed
* Update preoptimizing-images.md
* Remove images having 3x dimensions of original
* Make tests not include 3x image size checking
* Remove all instances of 3x images and related code
* Remove 3x sizing from gatsby-source-contentful/extend-node-type.js
* Revert changes to gatsby-source-contentful
* Revert changes to examples/using-contentful
* five -> four to reflect one image size being removed
* Update preoptimizing-images.md
* Update e2e-tests/gatsby-image/cypress/integration/fixed.js
Co-Authored-By: Dustin Schau <[email protected]>
* test: add a negation test for the 3x srcset
Copy file name to clipboardExpand all lines: docs/blog/2019-04-02-behind-the-scenes-what-makes-gatsby-great/index.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -394,7 +394,7 @@ There are far, far, far too many otherwise decently performing websites that loa
394
394
- Responsive, optimized images using a `srcset`
395
395
- A [`picture`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture) element with a `source srcset` is used
396
396
- This means that using several media queries, you load the smallest image that matches your device (e.g. mobile devices get smaller images, desktop devices get larger images, etc.)
397
-
- We even generate 2x and 3x DPi images for beautiful images, regardless of the screen quality!
397
+
- We even generate 2x DPi images for beautiful images, regardless of the screen quality!
398
398
- A base64 blurred image loaded by default
399
399
- This has two wins: 1) Larger images outside the viewport are not requested until they're needed, and 2) The blurred image is in a container with the same dimensions as the real image--therefore, no jumping when the image loads!
400
400
- Also see: [traced SVGs for a super slick alternative](/packages/gatsby-plugin-sharp/#tracedsvg)
Copy file name to clipboardExpand all lines: docs/docs/preoptimizing-images.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,11 @@ title: Preoptimizing your Images
4
4
5
5
Gatsby ships with excellent image optimization capabilities (see the [Image Tutorial](/tutorial/image-tutorial/) for more info). However, this image optimization can come with a cost. It can be fairly CPU intensive, and in some cases may lead to long build times. As a means of debugging and perhaps improving your overall build performance, it _may_ be helpful to pre-optimize your (extremely large) images.
6
6
7
-
First, some context. `gatsby-plugin-sharp` ships with a `fluid` option which will attempt to create five images intended to map to various screen resolutions. Producing multiple images ensures that your images are ready and optimized for phone displays, desktop displays, and everything in between. This plugin receives a non-optimized image and produces optimized images for _all_ of your users and devices. Magic!
7
+
First, some context. `gatsby-plugin-sharp` ships with a `fluid` option which will attempt to create four images intended to map to various screen resolutions. Producing multiple images ensures that your images are ready and optimized for phone displays, desktop displays, and everything in between. This plugin receives a non-optimized image and produces optimized images for _all_ of your users and devices. Magic!
8
8
9
9
If you find yourself running into build performance issues, it could be helpful to consider applying some image optimizations. Images in your setup _could_ be overly large, especially compared to the requested image sizes in your layout (e.g. if your layout has a max width of 600 pixels).
10
10
11
-
For instance, if your layout is 600 pixels wide, then the highest resolution image you will need is 1800 pixels to account for 3x pixel density. If you have images that are 3000 or 4000 pixels wide then you could resize your image to 1800 pixels, which may improve overall build performance.
11
+
For instance, if your layout is 600 pixels wide, then the highest resolution image you will need is 1200 pixels to account for 2x pixel density. If you have images that are 3000 or 4000 pixels wide then you could resize your image to 1800 pixels, which may improve overall build performance.
12
12
13
13
Here's an example script to pre-optimize your image dimensions and slightly compress. This optimization may serve as a helpful technique to possibly improve build time if your local repository has many, very large images.
0 commit comments