A Linux script that creates srcset images for webp, png, jpg or any image type a web developer needs.
A Linux script that creates srcset images for webp, png, jpg or any image type a web developer needs.

seen from United States
seen from Slovakia
seen from United States
seen from United Kingdom
seen from China
seen from United States

seen from T1
seen from China
seen from United Kingdom
seen from China

seen from T1
seen from United States
seen from United States

seen from Australia
seen from Australia

seen from Malaysia

seen from Russia

seen from Malaysia
seen from United Kingdom
seen from China
A Linux script that creates srcset images for webp, png, jpg or any image type a web developer needs.
A Linux script that creates srcset images for webp, png, jpg or any image type a web developer needs.
SEO基礎-圖像的搜尋引擎優化
一個好的文章,
通常是圖文並茂的,
而圖文並茂的文章也能夠讓文章更為生動,
進而吸引更多的讀者,
也能幫助觀眾能夠透過圖片理解文章闡述的內容,
如何能找一個對SEO有幫助的圖片呢?
這就是今天的主題:
SEO基礎-圖像的搜尋引擎優化
尋找要使用的圖表,照片或者插圖,
要注意底下幾個要點:
選擇適當的檔案格式
在選擇圖像與照片的時候,
較大的圖片與照片以JPEG檔案為主,在色彩與清晰度上效果較佳
希望保持圖片背景的透明度的話則以PNG檔案為主
若要隨意調整大小的圖片以SVG檔案為主
使用響應式圖片
如果是使用wordpress的話,
在4.4版以後,
預設就有支援,
圖片應該要有srcset屬性,
它可適用於各式不同顯示寬度的顯示器,
特別是平…
View On WordPress
WEBでレスポンシブ対応するときに結構大変なのが画像の扱い。iPhone等の高解像度デバイス(Retinaディスプレイ等)には2倍の画像を用意する必要があるし、最近は画面のサイズに会わせて画像を切り替えたい場合も多い。そんな時にHTML5のsrcsetがすこぶる便利だったのでご紹介します。
IphoneといえばRetinaだから画像がぼやけない対応をしている企業も多いのですが、自社では基本あまりやってきませんでした。
記述が面倒だからなのと時間がかかるから。
スマホ用とPC用を入れ替えたり、倍のサイズを毎回作ってたら表示スピードも遅くなります。
今回の方法ではsrcsetは対応したもののみそちらで表示する用になっているのでスピードが落ちる心配もありません。
pictureタグを今までこういうときに使用してきたのですが、今後はこちらでも良いのかなと思いました。
今後また使いたいときのためにメモします。
Начиная с версии 4.4 в WordPress, по умолчанию встроен параметр srcset который позволяет адаптировать картинки находящиеся непосредственно в шаблоне. Но как показала практика, Google PageSpeed Insights не правильно воспринимает этот параметр и понижает качество загрузки страницы....
Take advantage of the new element and new features of in your next responsive website.
Jumbo Srcset Large Services
Facilities Management - Jumbo Srcset Large Services
Create responsive images easily
In terms of images, sometimes building a web application may turn out to be a difficult process, since there are a wide rage of methods to do it. After trying diverse techniques, this post explains how to deliver efficiently responsive images by making use of the <picture> element, <source> element, media and srcset attributes.
Our aim is to provide multiple images for different device resolutions on demand. In some cases, we’ll need not only to make various image sizes available, but to serve images with great detail, which we’ll refer as art direction.
As mentioned before, users will access our app using multiple devices. We’ll need to test how images are displayed in various screen sizes and resolutions. One of the ways to test responsive design is through Chrome DevTools. Let’s use an emulated Google Nexus 5 phone to introduce some concepts we’ll need later:
- Device dimensions: CSS pixel dimensions of the device. Really useful for web developers, since CSS and Media Queries will respond to these. - DPR: device pixel ratio or CSS pixel ratio, which is the ratio between physical pixels and CSS pixels. It determines how a device resolution is interpreted by the CSS. For instance, Google Nexus 5 will render at 3x. - Rendered pixels: device dimensions are multiplied by DPR to render elements. The interpreted resolution for Google Nexus 5 is (360x3) x (640x3) = 1080x1920. - Physical pixels: actual pixels of the hardware. - Physical size: length of its diagonal in inches.
Icon by Martin Jordan from the Noun Project
Let’s break down the steps to render the best images based on device characteristics :
1- Configure viewport
Set the meta viewport tag on the <head> section of the HTML document. This will ensure browsers render your app and scale the content properly in a variety of devices. With width=device-width, content will match all screen sizes. minimum-scale=1.0 is the minimum amount the user can zoom. initial-scale=1 is the initial zoom when page is loaded. user-scalable allows the user to zoom the page in and out.
2- HTML document and CSS
On the body of your HTML document, include a <picture> element to serve multiple versions of an image. In this example I applied the art direction for some images, serving cropped versions to give proper detail in small / large screen sizes.
See how inside the <picture> element I added: <source> element with “media” and “srcset” attributes, as well as an <img> element. The <picture> element contains two sources that serve alternate versions of the image. We’ll use media queries to display these images at different viewports.
We set srcset attribute with “integer + x” after the image URL, which is the device pixel ratio or DPR. This means that the browser can decide which images to download based on its DPR, so for higher DPR the browser will use the image with higher resolution.
For viewports that are wider than 750px, for 1x device there is a 1x image available, which is 1500 pixels wide. And for 2x device there is an image with twice the pixel density (3000 pixels wide).
For viewports greater than 500px and less than 750px, the browser will load the image provided by srcset element (1000 pixels wide).
The <img> element acts as the fallback content, so if none of the sources are loaded, this <img> will be displayed by default. This will be also used in viewports that are narrower than 500px.
Finally, CSS tells the browser at what wide images must be displayed. So we insert max-width and width to 100vw to the <img> element, meaning that this image will be displayed at 100% of viewport size.
3- CSS for <img> element
For the rest of the images in the demo blog, the styles need to be applied to the <img> element. I included a max-width of 100% and a transition effect to all images.
4- Time to test it with Chrome DevTools
Now we need to test our code and make sure is working! Let’s use the Network tab from Chrome DevTools and test it with Google Nexus 5. Since its width is 360px, less than 500px, the browser will load the image contained in <img> element.
We can test this in any device. Finally, let’s check that our <source> element and its attributes are running, using an Apple iPad. It has a width of 1024px, so it will apply the media query for devices with more than 750px. Notice that the browser only downloads the 2x images that correspond to a 2x device, just what we were looking for!
Check out the code in github.
Aprimore as imagens com srcset para dispositivos com DPI alto
Aprimore as imagens com srcset para dispositivos com DPI alto
O atributo srcset melhora o comportamento do elemento img, facilitando o fornecimento de diversos arquivos de imagem para dispositivos com características diferentes. Assim como a função image-set nativa do código CSS, o srcsetpermite ao navegador escolher a melhor imagem conforme as características do dispositivo, por exemplo, usando uma imagem 2x em uma tela 2x e, possivelmente no futuro, uma…
View On WordPress