惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Cybersecurity and Infrastructure Security Agency CISA
D
Darknet – Hacking Tools, Hacker News & Cyber Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Schneier on Security
L
Lohrmann on Cybersecurity
S
Securelist
P
Palo Alto Networks Blog
SecWiki News
SecWiki News
T
Troy Hunt's Blog
H
Hacker News: Front Page
AWS News Blog
AWS News Blog
Latest news
Latest news
Hacker News - Newest:
Hacker News - Newest: "LLM"
NISL@THU
NISL@THU
The Hacker News
The Hacker News
F
Full Disclosure
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
大猫的无限游戏
大猫的无限游戏
O
OpenAI News
P
Proofpoint News Feed
Know Your Adversary
Know Your Adversary
G
GRAHAM CLULEY
博客园_首页
Attack and Defense Labs
Attack and Defense Labs
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Security Latest
Security Latest
云风的 BLOG
云风的 BLOG
K
Kaspersky official blog
WordPress大学
WordPress大学
www.infosecurity-magazine.com
www.infosecurity-magazine.com
宝玉的分享
宝玉的分享
L
LINUX DO - 热门话题
博客园 - 叶小钗
L
LINUX DO - 最新话题
Martin Fowler
Martin Fowler
N
News | PayPal Newsroom
Project Zero
Project Zero
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
PCI Perspectives
PCI Perspectives
月光博客
月光博客
IT之家
IT之家
Recent Announcements
Recent Announcements
T
The Exploit Database - CXSecurity.com
D
DataBreaches.Net
J
Java Code Geeks
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
Google Online Security Blog
Google Online Security Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

ImageKit.io Blog

Next.js Image Optimization with ImageKit Use Video as a Background in Your Next.js Project How to Fix Autoplay Video in Next.js How Durian Scaled a Visual-First Retail Experience to 350K Monthly Visitors Online How Matsmart accelerated image delivery across countries with ImageKit AI in Digital Asset Management: From Smart Workflows to Agentic Automation How Joseph Joseph unified and secured global video delivery with ImageKit How Modall powers fast, effortless media delivery across 40+ projects with ImageKit Digital Asset Management (DAM) Trends: 2026 Report How to add a poster image to Video.js player (and automate it) HLS streaming with Video.js + React Building the future of storytelling with fast, AI-powered video delivery How PushOwl delivers 100M+ image-rich notifications seamlessly with ImageKit How Homify delivers millions of interior design images seamlessly with ImageKit Better event discovery with lightning‑fast videos & images Adding video player in React Native Video player in Angular applications Crop and resize videos in React Next.js image and video upload React image and video upload React video optimization How we quadrupled our traffic to 625K monthly page views How Apollo 24|7 boosted performance & reduced costs with ImageKit Simplify your media workflows with ImageKit DAM integrations Extending Lighthouse for custom image and video optimization analysis Brand Asset Management: What is it? How does it work? WordPress Digital Asset Management Guide - Manage your WP media assets better Why Shopify retailers need a digital asset management solution DAM vs. SharePoint: Which is best for you? AI-powered Metadata and Tagging in Digital Asset Management How Hopscotch built India's largest online Kids' fashion brand with ImageKit Dropbox Vs. DAM: Which Is The Right Tool For Digital Asset Management Digital Asset Management for Photographers: A Complete Guide Why digital asset management for agencies is essential Helping both Top and Bottom Line: SaffronStays rapid, profitable growth with ImageKit How KreditBee simplified media experiences with ImageKit Google Drive alternatives for businesses (with fast-growing teams) Node.js image upload ImageKit: The Secret Ingredient in Swiggy’s Expansion Journey Streamlining the Design Approval Process: A Comprehensive Guide AV1 Codec - Complete guide for video application devs PHP image and video upload Angular image & video upload AV1 vs VP9: Which codec should you choose? Adding video player in Next.js React Video Player VP8 vs VP9 - In the context of online video delivery Exploring WebM vs MP4 7 Free Digital Asset Management Software that are not Open-Source Comparing 9 Top Digital Asset Management Tools in the Market What are Brand Standards and Why do they Matter? Boost Sales and Brand Appeal: Essential Tips for eCommerce Image Management Brand Recall: The Strategy to Create Unforgettable Brands How to upload files in HTML? Branding for Small Businesses (2025 Edition) Everything you need to know about VP9 codec Recent updates from ImageKit and what's next Best Ways to Write RFP For Digital Asset Management (+ with free RFP template) What is Brand Dilution? How to Avoid It? Explained with [Examples] The Importance of Brand Identity: Leveraging Digital Asset Management for Impact From Launch to Scale: How to Launch a Brand Campaign Digital Asset Management Requirements - What do You Need to Evaluate and How? Marketing Collateral Management: A Quick End-to-End Guide Video Content Management System: What Is It And How To Choose One? Dropbox vs. Google Drive vs. Onedrive: The Best Cloud Storage Solution How to Build Brand Trust: Get Started In 2025 Google Drive vs. Box: A Detailed Comparison How Digital Asset Management Solutions Help Protect Brand Equity A DAM Solution Can Safeguard Your Digital Intellectual Property - Here’s How WebP Vs. PNG: Which Image Format Should You Use and Why? How to Resize Images in Bootstrap Easily Progressive jpegs (PJPEG): the key to loading images faster on your website Dropbox vs. Google Drive: The Best Cloud Storage For Digital Assets Dropbox Pros & Cons In 2024: An In-Depth Analysis and Why A DAM Solution Stands Out Google Drive Vs OneDrive: The Better Storage Option For Digital Assets Manage your video assets better with video metadata Understanding DAM's Role in Strengthening Brand Identity Digital asset management strategy: What to know before creating one The Ultimate Guide To Marketing Agency Onboarding 6 Solutions To Simplify Large File Sharing Over The Web A Step-by-Step Breakdown of a Video Production Workflow 13 Digital Asset Management Use Cases You Should Know How to Conduct a Brand Audit and Manage Your Brand Assets Costly Consequences of Inconsistent Branding And How DAM Can Help Dynamic Asset Transformation: What It Is, Why You Need It, and How ImageKit Can Help Everything You Need to Know About HTML Video Autoplay How To Select Your DAM Vendor: A Complete Guide How to Boost User Experience with Smart Digital Asset Management React Image Optimization: A Guide for Web Developers Why Should DAM Be A Part Of Your MarTech Stack? Unleashing the Power of Content Repurposing with ImageKit MKV vs MP4: Which Video File Format Is Better for Your Needs? Digital Asset Management For Ecommerce: A Complete Guide How an Image Tagging Software can Transform Your Image Search How to Manage Your Content Lifecycle Effectively M4V vs MP4: Which Video Format Should You Use and Why? Why Every Business Needs An Image Management System All The Questions To Ask During A Dam Demo Which is the Best Image Format for Your Website? Uploading Multiple Files Using JavaScript: A Comprehensive Guide
How To Use Named Transformations For Better Code Readability And Maintenance
Manu Chaudhary · 2020-01-01 · via ImageKit.io Blog

What is named transformation in ImageKit.io?

Named Transformations within ImageKit.io are aliases or names you can give for a complex URL transformation string. For example, if you are resizing an image to 300x200px and adding a blur to the image.

Original URL:https://ik.imagekit.io/demo/img/tr:w-300,h-200,bl-10/default-image.jpg.
URL with Named Transformation:https://ik.imagekit.io/demo/img/tr:n-blurred_thumbnail/default-image.jpg

Here, we replace the transformation string tr:w-300,h-200,bl-10 with an easy-to-remember alias - blurred_thumbnail.

How To Simplify Code Using Named Transformation

Let’s say you have a website with three column layout like this:

Three-column layout
Three-column layout

ImageKit.io provides tons of resizing and cropping image transformations using URL parameters. This means that you can use ImageKit.io width and height resizing on the master image and can get the desired image size.

Let's say we need a 400x300 image for our three-column layout for desktop.

The image URL will be https://ik.imagekit.io/demo/img/tr:w-400,h-300/image1.jpeg

Now tr=w-400,h-300 is simple enough string that you can directly use in your theme files. However, as this layout changes in the future, there is a good chance that this transformation string will change and become less readable.

Suppose one of the members of your UI development team wants to use the automatic smart cropping feature provided by ImageKit.io. So they will need to add the fo-auto parameter.

Now let’s say you want to get an exact dimension image and want ImageKit.io to automatically add padding around the image if necessary using cm-pad_resize crop parameter.

So the transformation string becomes tr:w-400,h-300,fo-auto,cm-pad_resize. Now let’s support different DPR values provided by ImageKit.io. This will require adding dpr-value.

So now the transformation string becomes:

  • tr:w-400,h-300,fo-auto,cm-pad_resize,dpr-2
  • tr:w-400,h-300,fo-auto,cm-pad_resize,dpr-3

Given the different types of layouts on your page and the complexity of your website, you can imagine that the codebase will quickly become scattered with these ImageKit.io resizing parameters. And as different team members work on a piece of code, they will keep introducing new parameters. This is not good for maintaining good code quality.

We can simplify this problem using named transformations.

Creating Named Transformations

Navigate to the Named Transforms section within Image Settings on your dashboard. Click on 'Add New'.

Within the popup, give a name for the transformation string. For example, the name could be listing_page_thumbnail , and the transformation string could be tr:w-400,h-300,fo-auto,cm-pad_resize,dpr-3.

image result for securing images from theft
image result for securing images from theft

Always test your transformation before saving it as a named transformation. You can test by clicking on the message that appears at the bottom of the popup.

Save the transformation. You can now replace the string tr:w-400,h-300,fo-auto,cm-pad_resize,dpr-3 with tr:n-listing_page_thumbnail to use named transformations within your URL.

Editing Named Transformations

Navigate to the Named Transforms section within Image Settings on your dashboard.

Click on ... next to the named transformation you want to edit. A popup window appears.

Edit the named transformation name or value, and enable/disable the named transformation from the popup.

Click "Submit". The changes apply to every new image URL request. For older images, please clear the cache or contact support through your dashboard, or email us at support@imagekit.io

Benefits Of Using Named Transformations

Easy to read and remember

There are usually 4-5 different image sizes and variations on a website. In some cases, we have even seen 8+ variations of the same image on the same website. In such a scenario, it isn't very easy to remember each transform parameter.

As you saw in the above example, named transforms make it simple. Configure them once and get easy-to-remember names for all your transforms.

image result for securing images from theft
image result for securing images from theft
`<style>`
`<style>`

You can create multiple image transformations in the ImageKit.io dashboard like this:

Named transformationActual transformation
tr:n-2x_announcementstr:w-18,h-18,cm-pad_resize,dpr-2
tr:n-xxxhdpi_announcementstr:w-18,h-18,cm-pad_resize,dpr-4
tr:n-xhdpi_announcementstr:w-18,h-18,cm-pad_resize,dpr-2
tr:n-mdpi_announcementstr:w-18,h-18,cm-pad_resize,dpr-1

Developer Productivity, Communication, and Consistency

Because named transforms are easy to remember and communicate, they also improve the productivity of your development/technology team  and the consistency in the codebase.

Instead of remembering the exact transformation parameters, your developers would know that they have to use thumbnail transformation on product search pages. This results in better communication in the team and consistency while writing the code as all the developers would always use the same name to achieve the same transformation.

Security

You have an option to restrict the direct use of ImageKit.io transformation parameters in the URL. This will prevent any third parties which are trying to use images from your website and changing the image transformation as per their requirement

From the ImageKit.io dashboard under image settings, you can prevent any other unnamed transform from being applied to the image.

Note: You can use URL signatures to counter this problem and get fool-proof non-modifiable URLs. But implementing signatures may require significant development effort for your team.

Cache Purging While Using Named Transformations

Let’s say you edit a named transformation from the dashboard. Now, ImageKit.io doesn’t automatically purge all the images using that named transformation for performance reasons. In that case, please raise a support request either from the dashboard or by writing to us at support@imagekit.io

Conclusion

So essentially, named transformations help you write more readable and maintainable code. At the same time, by restricting the usage of unnamed transformation, you can make sure that any third party doesn't misuse your image URLs. The only point to keep in mind while using named transformation is always to purge the cache when you edit a named transformation from the dashboard.