ピクシブ百科事典 (概要のみ) 20240224

jpg和png是不确定的,是无奈之举才用的js动态添加,gif应该是没有的。

原始网站的图片都是小的压缩图均为jpg,我还原原图网址拓展名就不确定了。

可能下载压缩图做离线mdd对存储空间更实际。

有很多404,换成gif就下载了,很麻烦,得重复下载很多次,每次试一个extension
如果都有jpg就不会出现404了。最好楼主把原来的数据分享一下。

jpg很难再压缩了,除非降低画质很多。
mdd对图片的压缩几乎不到1%

pic.7z (3.5 MB)
都是120*120尺寸的,搞离线有点卖力不讨好的感觉。

都是体力活。体积恐怖大。当然如果断网了可能就值得拥有了。

pe.js.txt (1.1 KB)
改成js后缀,兼容mdict,应该。

可以兼容并显示了。楼主威武!!!

you could downscale the media, webp is the most lightweight format

Seems to cut down file size by half - though at the cost of webp browser incompatibility (for Mdict PC etc)

most people use goldendict-ng

Many are still using MdictPC or BlueDict or Eudic etc. Would like to have max compatibility.

Photoshop can batch downsize via quality loss jpg files. Seems to drop by similar margins. Requires the software of course.

well, then you can do as follows:

  • convert it all to png
  • then pass to a compressor

GitHub - starmorph/compress-png-file: compress a png image file with python. customizable specific output sizes.

Am aware of png compression, I actually did a comparison between different schemes of compression, ends up being the same (if lossless). Most png compression are CPU hogs, so going through 500K files could be prohibitive.

i think it can still be done, with the help of a python script, but you’d need to cut the quality of those images to half, which is not a problem since it’s only a dictionary

compress_image(image_path, output_path, output_size, quality=50)

1 个赞

Need to compare size and CPU cost of jpg → png → 50% qual vs jpg → 50% qual

For sure webp drops quality noticeably but not destructively and CPU usage is near zero and time taken is negligible per file except for the webp file type. Maybe I should convert it back into jpg or original file type. nevermind, size blew up 3 fold if converted back into jpg.

1 个赞

yeah, webp would be a good choice

want to keep file name untouched ideally though.

1 个赞

很喜欢这部辞典,如果能做成带有图片的离线版,那是再好不过了。期待。

1 个赞

yeah, that’d be great

I converted all images into avif format with little CPU consumption. The total size is only 1/20-1/27th of that of the original, quite astonishing, with almost no discernible quality drop across all image formats and sizes.

The catch is only GD supports this format. For some reason, my test mdx containing just 1 avif file works fine. However, the full mdx loads images initially in a flash, then the image disappears. Trying to figure out why…