কম্পিউটার টিউটোরিয়াল

CSS Transform ও Scale ব্যবহার করলে ছবির গুণগত মান রক্ষা করা


CSS image-rendering প্রপার্টি আমাদের ছবি স্কেল করার জন্য একটি অ্যালগরিদম সেট করতে সাহায্য করে।

সিনট্যাক্স

CSS image-rendering প্রপার্টির সিনট্যাক্স নিচে দেওয়া হলো:

Selector {    image-rendering: /*value*/ }

উদাহরণ

নিচের উদাহরণগুলো CSS image-rendering প্রপার্টি ব্যাখ্যা করে।

<!DOCTYPE html> <html>    <head>       <style>          img {             height: 200px;             width: 200px;          }          #one {             image-rendering: smooth          }          #two {             image-rendering: pixelated          }          #three {             image-rendering: crisp-edges          }       </style>    </head>    <body>       <img id="one" src="https://images.unsplash.com/photo-1610208309350-766d71494a03?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=128&ixlib=rb-1.2.1&q=80&w=128" />       <img id="two" src="https://images.unsplash.com/photo-1610208309350-766d71494a03?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=128&ixlib=rb-1.2.1&q=80&w=128" />       <img id="three" src="https://images.unsplash.com/photo-1610208309350-766d71494a03?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=128&ixlib=rb-1.2.1&q=80&w=128" />    </body> </html>

এটি নিচের আউটপুট দেয়:

CSS Transform ও Scale ব্যবহার করলে ছবির গুণগত মান রক্ষা করা

উদাহরণ

<!DOCTYPE html> <html>    <head>       <style>          img {             padding: 5%;             border-radius: 40%;             height: 20%;             width: 20%;          }          #one {             image-rendering: pixelated          }          #two {             image-rendering: smooth          }          #three {             image-rendering: crisp-edges          }       </style>    </head>    <body>       <img id="one" src="https://images.unsplash.com/photo-1611090093783-a629a4d9f1a1?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=256&ixlib=rb-1.2.1&q=80&w=256" />       <img id="two" src="https://images.unsplash.com/photo-1611090093783-a629a4d9f1a1?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=256&ixlib=rb-1.2.1&q=80&w=256" />       <img id="three" src="https://images.unsplash.com/photo-1611090093783-a629a4d9f1a1?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=256&ixlib=rb-1.2.1&q=80&w=256" />       <br/>       pixelated, smooth, crisp    </body> </html>

এটি নিচের আউটপুট দেয়:

CSS Transform ও Scale ব্যবহার করলে ছবির গুণগত মান রক্ষা করা

  1. CSS দিয়ে থাম্বনেইল ইমেজ তৈরি

  2. CSS ইমেজ স্প্রাইট ব্যবহারের সুবিধা

  3. CSS ২D ট্রান্সফর্ম ফাংশন (Transform Functions)

  4. ওয়ার্ড, এক্সেল, পাওয়ারপয়েন্টে ছবির গুণগত মান সংরক্ষণ করার উপায়