
- CSS - Home
- CSS - Roadmap
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Types
- CSS - Measurement Units
- CSS - Selectors
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Border Block
- CSS - Border Inline
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursor
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS - Inline Block
- CSS - Dropdowns
- CSS - Visibility
- CSS - Overflow
- CSS - Clearfix
- CSS - Float
- CSS - Arrows
- CSS - Resize
- CSS - Quotes
- CSS - Order
- CSS - Position
- CSS - Hyphens
- CSS - Hover
- CSS - Display
- CSS - Focus
- CSS - Zoom
- CSS - Translate
- CSS - Height
- CSS - Hyphenate Character
- CSS - Width
- CSS - Opacity
- CSS - Z-Index
- CSS - Bottom
- CSS - Navbar
- CSS - Overlay
- CSS - Forms
- CSS - Align
- CSS - Icons
- CSS - Image Gallery
- CSS - Comments
- CSS - Loaders
- CSS - Attr Selectors
- CSS - Combinators
- CSS - Root
- CSS - Box Model
- CSS - Counters
- CSS - Clip
- CSS - Writing Mode
- CSS - Unicode-bidi
- CSS - min-content
- CSS - All
- CSS - Inset
- CSS - Isolation
- CSS - Overscroll
- CSS - Justify Items
- CSS - Justify Self
- CSS - Tab Size
- CSS - Pointer Events
- CSS - Place Content
- CSS - Place Items
- CSS - Place Self
- CSS - Max Block Size
- CSS - Min Block Size
- CSS - Mix Blend Mode
- CSS - Max Inline Size
- CSS - Min Inline Size
- CSS - Offset
- CSS - Accent Color
- CSS - User Select
- CSS - Cascading
- CSS - Universal Selectors
- CSS - ID Selectors
- CSS - Group Selectors
- CSS - Class Selectors
- CSS - Child Selectors
- CSS - Element Selectors
- CSS - Descendant Selectors
- CSS - General Sibling Selectors
- CSS - Adjacent Sibling Selectors
- CSS Advanced
- CSS - Grid
- CSS - Grid Layout
- CSS - Flexbox
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Paged Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS - Image Sprites
- CSS - Important
- CSS - Data Types
- CSS3 Advanced Features
- CSS - Rounded Corner
- CSS - Border Images
- CSS - Multi Background
- CSS - Color
- CSS - Gradients
- CSS - Box Shadow
- CSS - Box Decoration Break
- CSS - Caret Color
- CSS - Text Shadow
- CSS - Text
- CSS - 2d transform
- CSS - 3d transform
- CSS - Transition
- CSS - Animation
- CSS - Multi columns
- CSS - Box Sizing
- CSS - Tooltips
- CSS - Buttons
- CSS - Pagination
- CSS - Variables
- CSS - Media Queries
- CSS - Functions
- CSS - Math Functions
- CSS - Masking
- CSS - Shapes
- CSS - Style Images
- CSS - Specificity
- CSS - Custom Properties
- CSS Responsive
- CSS RWD - Introduction
- CSS RWD - Viewport
- CSS RWD - Grid View
- CSS RWD - Media Queries
- CSS RWD - Images
- CSS RWD - Videos
- CSS RWD - Frameworks
- CSS References
- CSS Interview Questions
- CSS Online Quiz
- CSS Online Test
- CSS Mock Test
- CSS - Quick Guide
- CSS - Cheatsheet
- CSS - Properties References
- CSS - Functions References
- CSS - Color References
- CSS - Web Browser References
- CSS - Web Safe Fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
CSS - image-rendering Property
CSS image-rendering property is used to control how an image should be rendered or displayed by the browser. It specifies the algorithm that the browser should use when scaling the image up or down, as well as when displaying the image at sizes that are not a multiple of the image's intrinsic dimensions.
Syntax
image-rendering: auto | smooth | high-quality | crisp-edges | pixelated | initial | inherit;
Property Values
Value | Description |
---|---|
auto | It allows the browser to use an appropriate scaling algorithm. Default. |
smooth | It uses an algorithm that smooths the color in the image. |
high-quality | It is similar to smooth but importance is given to high-quality scaling. |
crisp-edges | It uses an algorithm that preserves contrast, colors and edges of the image without any smoothing or blurring. |
pixelated | It uses an algorithm that applies a pixelated effect when scaling the image, which can give a retro or low-resolution appearance. |
initial | It sets the property to its default value. |
inherit | It inherits the property from the parent element. |
Examples of CSS Image Rendering Property
The following examples explain the image-rendering property with different values.
Image Rendering Property with Auto Value
To allow the browser to automatically determine the best rendering method based on the image and the context, we use the auto value. This default setting balances quality and performance, adapting to the image's resolution and scaling requirements. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> img { width: 120px; } .demoImg { image-rendering: auto; } </style> </head> <body> <h2> CSS image-rendering property </h2> <h4> Original image: </h4> <img src="/css/images/scancode.png" alt="none"> <h4> image-rendering: auto </h4> <img class="demoImg" src="/css/images/scancode.png" alt="auto"> </body> </html>
Image Rendering Property with Smooth Value
To prioritize smoothness when scaling images such that the browser applies anti-aliasing techniques to minimize jagged edges and preserve the images visual appeal at various sizes, we use the smooth value. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> img { width: 120px; } .demoImg { image-rendering: smooth; } </style> </head> <body> <h2> CSS image-rendering property </h2> <h4> Original image: </h4> <img src="/css/images/scancode.png" alt="none"> <h4> image-rendering: smooth </h4> <img class="demoImg" src="/css/images/scancode.png" alt="auto"> </body> </html>
Image Rendering Property with High Quality Value
To allow the browser provide the best possible image quality which involves complex algorithms and higher computational resources to ensure that the image retains as much detail and clarity as possible when resized, we use the high-quality value. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> img { width: 120px; } .demoImg { image-rendering: high-quality; } </style> </head> <body> <h2> CSS image-rendering property </h2> <h4> Original image: </h4> <img src="/css/images/scancode.png" alt="none"> <h4> image-rendering: high-quality </h4> <img class="demoImg" src="/css/images/scancode.png" alt="auto"> </body> </html>
Image Rendering Property with Crisp Edges Value
sharp, well-defined edges rather than smooth transitions, we use the crisp-edges value. It maintains the crispness of each pixel, which can enhance the visual impact of images with hard edges. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> img { width: 120px; } .demoImg { image-rendering: crisp-edges; } </style> </head> <body> <h2> CSS image-rendering property </h2> <h4> Original image: </h4> <img src="/css/images/scancode.png" alt="none"> <h4> image-rendering: crisp-edges </h4> <img class="demoImg" src="/css/images/scancode.png" alt="auto"> </body> </html>
Image Rendering Property with Pixelated Value
To allow the image to be rendered with a blocky, low-resolution appearance, where each pixel is clearly visible, we use the pixelated value. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> img { width: 120px; } .demoImg { image-rendering: pixelated; } </style> </head> <body> <h2> CSS image-rendering property </h2> <h4> Original image: </h4> <img src="/css/images/scancode.png" alt="none"> <h4> image-rendering: pixelated </h4> <img class="demoImg" src="/css/images/scancode.png" alt="auto"> </body> </html>
Supported Browsers
Property | ![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|
image-rendering | 41.0 | 79.0 | 65.0 | 10.0 | 28.0 |