Image URL
Glossary
What is an Image URL?
An image URL is a specific web address that points directly to an image file online. These URLs are required for embedding images in websites, emails, and social media. Any product image or graphic you see on a website or an app will most likely be loaded using its image URL. Or, if you have to download an image or share it over the internet, you will likely do so using the image URL.
Structure of an Image URL
Like URLs for web pages, an image URL includes a protocol (e.g., HTTP or HTTPS), a domain, and a path to the image file. For example, an image URL typically looks like this:
https://www.example.com/images/sample.jpg
The URL structure comprises:
- Protocol: Indicates the transfer protocol (e.g., https).
- Domain: The website's domain name (e.g., www.example.com).
- Path: The path to the image file on the server (e.g., /images/sample.jpg).
Additional details in the image URL
With modern image CDNs like ImageKit.io that can optimize and transform images in real-time, an image URL can also contain:
- Image manipulation parameters: From basic resizing and cropping to more advanced watermarking, these parameters can be part of the URL to transform an image from its URL in real-time.
- The final output format and compression: Modern image CDNs can specify the image URL's desired output format and compression level. These CDNs can also automatically take care of compression and format optimization.
- Security-related parameters: Image URLs can also have some expiry or signature present, preventing URL modification or use after a specific time.
How to Obtain an Image URL
To obtain an image URL:
- From a Website: You can open a website in the browser, right-click the image, and select "Copy image address" or "Copy image URL."
- From a Browser Tab: When you right-click on an image on a web page, you can open the image in a new tab. After doing this, you can copy the URL from the address bar.
How to create optimized image URLs using ImageKit?
ImageKit is an image CDN that can optimize and transform images in real-time. You can use ImageKit to get an image URL in two ways:
- Upload an image to ImageKit's media library: You can use the user interface to upload an image and copy the image URL from the media library. Or you can use ImageKit's upload API to upload an image to the media library and get the image URL in response.
- Connect your external cloud storage: You can connect cloud storage like AWS S3, Google Cloud Storage, etc., to ImageKit and create image URLs using ImageKit for images stored in these storage.
Optimizations and transformations in image URLs using ImageKit
Once you have an image URL with ImageKit, you can use ImageKit’s image API to optimize and transform the image from its URL.
- If you enable automatic optimization settings, ImageKit compresses the image and converts it to the right format without any changes to the image URL.
- You can refer to the documentation of 50+ transformations available via the image URL and add these parameters to the URL on your own.
- Using the transformations you need, you can use one of the ImageKit SDKs for image URL generation.
ImageKit's image API offers several other advanced features like Smart Crop, AI-based Face, and object-aware crop, as well as adding image and text overlays on an image. The URLs also have an integrated content delivery network for superfast load time worldwide. You can use them directly on your websites and apps, share them with your teammates, and never have to worry about the user experience.
Conclusion
Image URLs are essential for integrating visual content on websites, apps, and other digital platforms. Image CDNs such as ImageKit make it easy to optimize and transform images as per your requirement in real-time directly from the image URL.