CSS3を使用して画像に色相回転を適用する
CSS3を使用して画像に色相回転を適用するには、フィルタープロパティに色相回転値を使用します。
例
例を見てみましょう-
<!DOCTYPE html>
<html>
<head>
<style>
img.demo {
filter: hue-rotate(45deg);
}
</style>
</head>
<body>
<h1>Learn Spring Framework</h1>
<img src="https://www.tutorialspoint.com/spring/images/spring-mini-logo.jpg" alt="Spring Framework" width="160" height="150">
<h1>Learn Spring Framework</h1>
<img class="demo" src="https://www.tutorialspoint.com/spring/images/spring-mini-logo.jpg" alt="Spring Framework" width="160" height="150">
</body>
</html> 出力
-
Pillowライブラリを使用して画像にMaxFilterを適用する
このプログラムでは、ピローライブラリを使用して画像に最小フィルターを適用します。最大フィルタリングでは、画像の選択されたウィンドウの各ピクセルの値が、そのウィンドウの最大ピクセルに置き換えられます。フィルタ機能は、ピローライブラリを使用してさまざまなフィルタを適用するために使用されます。 元の画像 アルゴリズム Step 1: Import Image from Pillow. Step 2: Open the image. Step 3: Call the filter function and specify maxfilter. Step 4: Display the output
-
Pillowライブラリを使用して画像にMinFilterを適用する
このプログラムでは、ピローライブラリを使用して画像に最小フィルターを適用します。最小フィルタリングでは、画像の選択されたウィンドウの各ピクセルの値が、そのウィンドウの最小ピクセルに置き換えられます。フィルタ機能は、ピローライブラリを使用してさまざまなフィルタを適用するために使用されます。 元の画像 アルゴリズム Step 1: Import Image from Pillow. Step 2: Open the image. Step 3: Call the filter function and specify minfilter. Step 4: Display the output