This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"github.com/disintegration/imaging" | |
"image/png" | |
"os" | |
) | |
func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image, ImageOps | |
import sys | |
import numpy as np | |
def gamma_correction(im, gamma): | |
arr = np.asarray(im) | |
arr = 255.0 * (arr / 255.0)**(gamma) | |
return Image.fromarray(np.uint8(arr)) | |
im = Image.open(sys.argv[1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image, ImageOps | |
import sys | |
im = Image.open(sys.argv[1]) | |
im = im.convert("YCbCr") | |
yy, cb, cr = im.split() | |
yy = ImageOps.equalize(yy); | |
im = Image.merge("YCbCr", (yy, cb, cr)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image, ImageOps | |
import sys | |
if len(sys.argv) < 4: | |
print ("Usage: python imageopt_test.py <grayscale|equalize|...> [<value>] <infile> <outfile>\n") | |
print (dir(ImageOps)) | |
exit (0); | |
method = sys.argv[1] | |
if len(sys.argv) == 4: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/local/bin/python3 | |
# https://docs.python.jp/3/library/http.server.html | |
# https://blog.sarabande.jp/post/81479479934 | |
from http.server import HTTPServer, SimpleHTTPRequestHandler | |
[host, port] = ["0.0.0.0", 4848] | |
class MyHandler(SimpleHTTPRequestHandler): | |
def do_GET(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# (c) [email protected] 2019/06/20- | |
# ref) https://pillow.readthedocs.io/en/stable/reference/Image.html | |
import sys | |
from PIL import Image | |
_rgb2xyz_rec709 = ( | |
0.412453, 0.357580, 0.180423, 0, | |
0.212671, 0.715160, 0.072169, 0, # RGB mixing weight | |
0.019334, 0.119193, 0.950227, 0 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* (c) 2017/08/21- [email protected] | |
* $ composer require yoya/php-svg | |
*/ | |
require_once("vendor/autoload.php"); | |
use SVG\SVGImage; | |
use SVG\Nodes\Structures\SVGStyle; | |
use SVG\Nodes\Structures\SVGDefs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* (c) 2017/08/21- [email protected] | |
* $ composer require yoya/php-svg | |
*/ | |
require_once("vendor/autoload.php"); | |
use SVG\SVGImage; | |
use SVG\Nodes\Structures\SVGStyle; | |
use SVG\Nodes\Structures\SVGDefs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* (c) 2017/08/21- [email protected] | |
* $ composer require yoya/php-svg | |
*/ | |
require_once("vendor/autoload.php"); | |
use SVG\SVGImage; | |
use SVG\Nodes\Structures\SVGStyle; | |
use SVG\Nodes\Structures\SVGDefs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* (c) 2017/08/21- [email protected] | |
* $ composer require yoya/php-svg | |
*/ | |
require_once("vendor/autoload.php"); | |
use SVG\SVGImage; | |
use SVG\Nodes\Structures\SVGStyle; | |
use SVG\Nodes\Structures\SVGDefs; |