docs/guides/manga/imagedit.md

1aa9e33f6d4b6afd9a1728630fba46f02fffe2fc
wotaku/docs/guides/manga/imagedit.md rendered · source · history · blame · raw

87 lines · 4774 bytes

 1---
 2title: Manga Image Editing
 3customDescription: Image Magick guide for Grayscaling, Leveling, and Optimizing
 4outline: [2,3]
 5og:
 6    image: https://files.catbox.moe/l2g45x.png
 7---
 8
 9
10<GradientCard title="Manga Image Editing" description="Image Magick guide for Grayscaling, Leveling, and Optimizing" theme="turquoise" variant="thin"/>
11
12
13
14A simple to understand guide covering the most important page edits.
15<Authors page="imagedit" />
16
17
18## Simple Denoising
19
20One can simple denoise pages using Waifu2x, which, contrary to its primary function, is not only used for upscaling. For Windows, you could use [**waifu2x-caffe**](https://github.com/lltcggie/waifu2x-caffe/releases), which has a GUI, but is limited to NVIDIA GPUs. Having a reasonably fast GPU is highly recommended (for reference: a GTX 1650 will perform well, while a GT 730 will struggle). Of course, you can denoise in CPU mode, but it will be much slower.
21
22Using the `2-D Illust (CUnet Model)` on `Level 2 Denoise Only` and `Use TTA Mode` unchecked is generally "good enough" for denoising on low to mid-range machines.
23Keep in mind that the denoise level depends on JPEG quality. There's no hard rule, but generally, for a q92 image, level 0 should be enough, whereas a q70 image would probably require level 2.
24
25![generic denoising](/ss/waifu.jpg)
26
27Under processing Speed Settings, it is recommended to leave the split size on default unless you are getting weird/incorrect outputs, in which case you might need to adjust it. You can increase the batch size if your GPU can handle more load to process the splits in parallel to speed up the denoising.
28
29The `Use TTA Mode` will process each split piece multiple times, rotating around (8 rotations in total). This generally improves the denoising, but the total processing will take 8 times longer, so for simple, fast, good-enough denoising, you can leave it unchecked unless you have the time for it.
30
31On a final note, it is recommended to set the output extension to PNG, as this is a lossless file format, unlike JPEG, which would reintroduce artifacts that you just took the effort to denoise.
32
33And last but not least: if you have a reasonably fast AMD GPU, consider using other Waifu2x implementations like [**waifu2x-snowshell**](https://github.com/YukihoAA/waifu2x_snowshell), as Waifu2x-Caffe only supports NVIDIA.
34
35<br>
36
37:::info Tools Needed
38
39The following tools will be used for any kind of grayscaling, leveling, and lossless optimizing:
40- [ImageMagick](https://imagemagick.org/index.php)
41- [Pingo](https://css-ig.net/pingo)
42- [imgdanke](https://github.com/DrWhoCares/imgdanke)<tooltip>Optional for GUI but does not support Pingo version 1+ at the moment.</tooltip>
43:::
44
45## Grayscaling
46
47The majority of the panels are black and white and can safely be grayscaled if they aren't already (e.g., 24-bit JPEGs or PNGs) to reduce the file size of those images.
48
49The command (CLI) to use with ImageMagick to batch process all images inside the current folder (that your command prompt is in) would be:
50
51```
52magick mogrify -format png -dither None -colorspace Gray *.png
53```
54
55## Leveling
56
57Leveling images is required when blacks aren't actually black, and after grayscaling, they may look a bit washed out. Before grayscaling, images can even have a hue or colored tint.
58
59![leveling example](/ss/scaling.png)
60
61### Stretching
62
63A simple method without too much effort would be using the `-contrast-stretch` option from ImageMagick, which will try to stretch the closest blacks to #000 and the highest whites to #fff. However, this does not work properly if there are pixels closer to black than the intended targeted blacks, as the stretch finds the lowest/highest colors.
64
65The command (CLI) to use with ImageMagick to batch process all images inside a folder would be:
66
67```
68magick mogrify -format png -dither None -colorspace Gray -contrast-stretch 0%x0% *.png
69```
70
71### Manual Leveling
72
73With manual leveling, you need to find the minimum black point to have your targeted blacks be actual black (#000) and raise the gamma to compensate for the raised blacks to avoid over-leveling the image. This can be somewhat of a trial-and-error process until you get a satisfying result. As a starting point, you can use the following value for ImageMagick: `13,100%,1.3` (used in the example image shown above), where 13 is the raised black point and 1.3 is the gamma adjustment value.
74
75The command (CLI) to use with ImageMagick to batch process all images inside a folder would be:
76
77```
78magick mogrify -format png -dither None -colorspace Gray -level 13,100%,1.3 *.png
79```
80
81## Optimizing
82
83You can safely and losslessly optimize images to reduce file size even more using the following command (CLI) with Pingo version 1+:
84
85```
86pingo -lossless -s4 path-to-folder
87```