Images and Logos
Learn how to replace photos and logos, generate responsive image sizes from the source, and adjust crops for different screen sizes.
Replace images in ready HTML
Section titled “Replace images in ready HTML”Replace the image files in dist/assets/, or update their paths in your HTML. Check both src and srcset: a browser may select a different image at another screen size. Keep suitable image proportions and enough resolution for the displayed size.
For logos, update the normal and light versions and their 2× files. Keep the displayed width and height appropriate for your new logo.
Replace images through Source
Section titled “Replace images through Source”- Find the image in
Source/src/data/image-pipeline.json. - Replace the original file listed in its
sourcefield, underSource/src/. For example,assets/images/content-boxes/blog-6.jpgis relative to that folder. - Run
npm run buildfromSource/, or leavenpm run devrunning while editing. - Check the resulting image and crops at desktop and mobile widths.
The build uses Sharp to create registered thumbnails and responsive sizes. You do not need an image processor on your web host. Replace the master image rather than editing generated thumbnails, which will be overwritten on the next build.
Original files are never overwritten: generated sizes are cached under Source/.cache/images. npm run images prepares only this cache; npm run build also updates the ready HTML and image files in dist/. Logos are not resized automatically and keep their normal and 2× files.
Crops and new images
Section titled “Crops and new images”The photo profile crops an image to fill its frame. product fits the complete product on white, while transparent preserves transparent cutouts. An optional focalPoint, such as [0.65, 0.35], moves the crop focus; values run from 0 to 1 from the top-left corner.
Register new images and their output sizes in image-pipeline.json if you need automatic thumbnails. Unregistered files are copied unchanged. CSS backgrounds do not receive an image element’s responsive srcset behavior.
Small source images are not enlarged automatically. Use a sufficiently large master and check faces, transparent edges and logo sharpness. The included Source/IMAGES.md explains advanced crop and output settings if needed.
Get all RT-Themes designs, updates and support with a single Club license.
Join the Club