我正在尝试使用graphicsmagick
node
icon.src
上的manifest.json
转换图片以减小文件大小。
png
下载到随机网站的jpg
ico
,svg
,webp
,16x16
,512x512
等)gm convert inputFilePath -colors 128 -size 64x64 -resize 64x64 +profile "*"
-depth 5 -define png:compression-filter=2 -define png:compression-level=9
-define png:compression-strategy=1 output.png
到 gm(inputPath)
.resize(64, 64)
.colors(128)
.bitdepth(5)
.noProfile()
.write(outputPath, function (err) {
if (err) {
console.error(err);
} else {
doSomething();
}
以下是我将在命令shell中执行的内容:
-define png: stuff
以下是我在javascript中尝试的内容:
$('button').filter(function () {this.id.match(/^check-button_/)}).click();
from holoviews.streams import Pipe, Buffer
from tornado.ioloop import IOLoop
from tornado import gen
import cv2
@gen.coroutine
def f():
pipe = Pipe(data=[])
#print(pipe)
vd = cv2.VideoCapture("TestVideo.mp4")
width = int(vd.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(vd.get(cv2.CAP_PROP_FRAME_HEIGHT))
frames = int(vd.get(cv2.CAP_PROP_FRAME_COUNT))
print("Hello")
for i in range(frames):
ret, frame = vd.read()
#print(i)
try:
rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
gen.sleep(10000000000)
pipe.send(rgb[:])
#print(str(i)+'x')
except:
#print(str(i)+'Error')
print("Error at Frame:"+str(i))
pass
vd.release()
cv2.destroyAllWindows()
IOLoop.current().add_callback(f)
hv.DynamicMap(hv.RGB, streams=[pipe])
添加到js?