Skip to content

Commit

Permalink
Bug fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Specy committed Feb 2, 2023
1 parent 2f89816 commit 8a04306
Show file tree
Hide file tree
Showing 5 changed files with 243 additions and 95 deletions.
91 changes: 68 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
"typescript": "^4.1.3"
},
"dependencies": {
"@types/get-pixels": "^3.3.2",
"@types/gif-encoder": "^0.7.1",
"fluent-ffmpeg": "^2.1.2",
"get-pixels": "^3.3.2",
"gif-encoder": "^0.7.2",
"gif-frames": "github:tenpi/gif-frames#no-cumulative",
"image-size": "^0.9.3"
"image-size": "^1.0.2"
}
}
9 changes: 5 additions & 4 deletions start.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import waifu2x from "./waifu2x"

import path from "path"
const base = path.join(__dirname, "../");
(async () => {
const progress = (current: number, total: number) => {
console.log(`Current: ${current} Total: ${total}`)
}
const progress2 = (percent: number) => {
console.log(`Percent: ${percent}`)
}
//const result = await waifu2x.upscaleImage("./images/laffey2.jpg", "./images/upscale/laffey3x.jpg", {scale: 4, upscaler: "real-esrgan"}, progress2)
const result = await waifu2x.upscaleGIF("./images/gifs/chibi.gif", "./images/gifs/chibi2x.gif", {scale: 2, upscaler: "real-esrgan"}, progress)
console.log(result)
//const result = await waifu2x.upscaleGIF(path.join(base, "./images/test.gif"), path.join(base, "./images/upscale/test.gif"), { upscaler: 'real-esrgan', parallelFrames: 3}, progress)
const result2 = await waifu2x.upscaleImage(path.join(base, "./assets/laffey.jpg"), path.join(base, "./images/upscale/laffey3x.jpg"), { upscaler: 'real-esrgan'}, progress2)
console.log(result2, result2)
})()
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"outDir": "dist",
"lib": ["es2020", "DOM"],
"declaration": true,
"esModuleInterop": true
},
Expand Down
Loading

0 comments on commit 8a04306

Please sign in to comment.