chutsetien 最近的时间轴更新
chutsetien

chutsetien

V2EX 第 22966 号会员,加入于 2012-07-03 13:34:59 +08:00
今日活跃度排名 13044
根据 chutsetien 的设置,主题列表被隐藏
二手交易 相关的信息,包括已关闭的交易,不会被隐藏
chutsetien 最近回复了
4 天前
回复了 est 创建的主题 Windows 还是以前 windows 主题好看
Windows 2000 是微软的美学巅峰。

但后续的也能接受,XP, Vista (Aero), 8/8.1 以及 10 都算是各有千秋,都有能够欣赏来的美的地方。但是 Windows 11 (Fluent UI) 不行,那是 10000% 的噁心人,丑出天际。视窗以及视窗内面板的大圆角实在是噁心透了。

Android 也是,4 到 8 代都很好看,但从 9 代开始引入那种大圆角后就噁心爆了,如今更是大圆角+像是吸食了 LSD 后带来的诡异的刺目粉色风,让人引起生理不适。

如今连 Firefox 都开始搞大圆角,我除了用 Aris-t2 的 CSS 恢复经典外观外,还直接给 userChrome 的 * 来了一个 {boder-radius: 0 !important;}, 直接彻底杜绝一切圆角,连下载的那个转圈填充都变成了方的。✕他✕的大圆角!

我把 MSO 留在了 2405 build 17628.20164, 就是因为这是最后一个可以启用非 Fluent UI 的 build, 自此之后的 builds 都强制启用 Fluent UI, ✕的真他✕的噁心爆了,✕!
@LogicDX342 所以说我真不是程序员哈哈,之前都没听说过这个~谢谢推荐。
@li1218040201 在我的个人 Wiki 上,因此不太方便贴。我真不是程序员,就是个从 DOS 一路走来的老一代电脑使用者,所以没有把这些放在 GitHub 之类的地方,自己的小站也是自娱自乐,就不献丑了 :)
@chutsetien 虽然知道可能没什么人看,但是加注一下:

> But since I use ffmpeg to encode JPEG files—which uses mjpeg as its encoder—the output files will then always be added with a ‘dash’ label in the names, indicating that they are intended for quick sharing uses, and are not expected to be used in serious scenarios.

这句是老版本里的,现在的这个脚本用的是 cjpegli, 不是 ffmpeg 的 mjpeg 了。
@chutsetien 顺附自写的该 batch 档的用法解释:

A tiny little Windows Batch script used for the cropping, scaling, and format conversion of images. It requires the following software to be properly set up in %PATH% (here in my case is C:\_c\):

ffmpeg;
libwebp;
optipng; and
exiftool.

Understanding ‘orientation-adaptive’ and ‘orientation-irrelevant’

As the script is used for the cropping and scaling of images, it would require the clarification of two concepts: ‘orientation-adaptive’ and ‘orientation-irrelevant’.

The former, as its name indicates, takes the image’s orientation into account. This can be easily understood in the context of scaling, as we often do need to scale an image by its ‘long edge’ or ‘short edge’, regardless of whether it is the width or the height.

It might get a little bit confusing when it comes to cropping. In cropping, by saying ‘orientation-adaptive’, it means that when given a ratio, the long edge always takes the first number, while the short edge takes the second. For example, if we have a horizontal image (which means its width is greater than its height), and we want to crop it to 4:3 orientation-adaptively, then the long edge, the width, will take the ‘4’ while the short edge, the height, will take the ‘3’. And when done, it would indeed be an image of 4:3. But if we have a vertical image (which means the height is the longer edge), and we still want to orientation-adaptively crop it to 4:3, then the height of the image, now the long edge, shall take the ‘4’, while the width of the image will take the ‘3’, and the final result we get is actually an image of 3:4.

What makes the ‘orientation-adaptive cropping’ more confusing is that it can be used to crop ‘against’ the image’s orientation by setting a ratio smaller than 1, in that it can force the long edge to take the smaller number in the ratio to become the new short edge while the original short edge can take the larger number and becomes the new long edge.

The ‘orientation-irrelevant’ scaling or cropping is much easier to understand—as its name indicates, it does not take the image’s orientation into account, only focusing on scaling or cropping based on the width and height, regardless of which one is longer.

Cropping switches

The script accepts switches used for cropping in an order of precedence as follows—if more than one switch is detected in one operation, a switch with a higher rank surpasses the lower ones:

-sq: crops the image to a 1:1 square;
-gr: orientation-adaptively crops the image to the golden ratio;
-gx: orientation-irrelevantly crops the image to the golden ratio by setting its width as the long edge;
-gy: orientation-irrelevantly crops the image to the golden ratio by setting its height as the long edge;
-cr x y: orientation-adaptively crops the image to a set ratio of x:y, where the long edge of the image takes the x, and the short edge takes the y;
-cx x y: orientation-irrelevantly crops the image to a set ratio of x:y, where the width of the image takes the x, and the height takes the y; and
-rg: performs a ‘reversed’ orientation-adaptive golden ratio cropping, where the long edge of the image takes the smaller number of the golden ratio, and the short edge takes the larger (not very useful actually, and that’s why it gets the lowest precedence).

Scaling switches

The script accepts switches used for scaling in an order of precedence as follows—if more than one switch is detected in one operation, a switch with a higher rank surpasses the lower ones:

-sl x: proportionally scales the image by setting its long edge to x;
-ss x: proportionally scales the image by setting its short edge to x;
-sx x: proportionally scales the image by setting its width to x;
-sy x: proportionally scales the image by setting its height to x;
-sf x y: proportionally scales the image by a given fraction of x/y; and
-sp x: proportionally scales the image by a given percentage x (‘%’ is not needed when giving the percentage number).

The script, by default, prohibits upscaling, unless the user explicitly orders the script to do so by changing the first letter of these scaling switches to ‘u’ (-ul, -us, -ux, etc). I strongly dissuade anyone who intends to use this script to upscale any image, for that image upscaling simply shall not be done in this way as it needs much more complicated algorithms and should be done with dedicated manual tuning.

Output file format and quality switches

The script accepts switches -p, -j, and -w to indicate an output of a .png image, a .jpg image, or a .webp image. These switches can be used simultaneously to output more than one image. For -j and -w, there are four quality suffixes, hq (‘highest quality’), mq (‘medium quality’), lq (‘low quality’), and pq (‘poor quality’), each representing a fixed quality parameter (or a group of fixed quality-related parameters in the case of -w), that can be used by immediately appending to the letter j or q, with no spaces in between, to form a five-tier image quality levels (together with the two default ones of no sticking letters, the -j and -w, which are both ranked second best in the hierarchy) for the user to choose. And by knowing me, you can rest assured that even by using -jpq or -wpq, the output will still be acceptable. But since I use ffmpeg to encode JPEG files—which uses mjpeg as its encoder—the output files will then always be added with a ‘dash’ label in the names, indicating that they are intended for quick sharing uses, and are not expected to be used in serious scenarios. If -p is detected, then the output .png file will be compressed by optipng with maximum tries, which means it will take a considerably long period of time if the image is large. Lastly, all of the output files will be cleaned of EXIF information in the end.

Designating output filename and path

By default, the output file or files will be saved in the same location as the input file, using the original filename as the basename with text labels of the process or processes being done to it and of the image quality parameter appended in the end. And yet the output filename and path are designatable with the switches listed below:

-op "path\to\the\designated location\": if used, the output files will then be exported to the designated location;
-ob new_basename: if used, then the given string will surpass the file’s original name and be used as the designated basename—the text labels for processed and image quality will still be appended to the given basename; and
-on "new filename": if used, then the given string will be used as the full filename of the output file, with no more appendings.

Since one operation of the script can produce more than one file in different formats, strings given after -ob and -on shall not contain a file extension, as it will be added automatically according to the output format.
首先,webp 的画质非常差,用 cwebp -mt -q 100 -m 6 -sharp_yuv -af -alpha_filter best -sns 0 压出来的 webp 都会与原图有放大后能够看到的明显区别,毕竟是 VP8 打底,最高水准也就那样了。当然,确实,体积小。
目前建议 jpegli. jpegli 的 q 90 感觉和上面那个各项打满的 q 100 的质量差不多。当然要求高一些的话可以往 q 95+ 走。
我有个自用的 batch 档,也是做转换和切割图片的——我不是 programmer, 真不是,而且 batch 纯自用,因此各种不足之处还请见谅了。不知道 V 站怎么贴,就试试看 markdown 了。
```
@echo off
chcp 65001
setlocal enabledelayedexpansion
set "a="
set "i="
set "fn="
set "bn="
set "on="
set "gn="
set "np="
set "op="
set "cm="
set "sm="
set "hg="
set "jq="
set "wq="
set "sl="
set "sp="
set "ss="
set "sx="
set "sy="
set "cr1="
set "cr2="
set "cx1="
set "cx2="
set "sf1="
set "sf2="
set "cmb="
set "smb="
set "vfb="
set "cpf="
set "spf="
set "jpg="
set "png="
set "wbp="
set "sns="
:a
if "%~1"=="" goto p
set "a=%~1"
if "!a:~0,1!"=="-" (
if "!a!"=="-op" (set "np=%~2" & shift)
if "!a!"=="-on" (set "gn=%~2" & set "hg=1" & shift)
if "!a!"=="-ob" (set "bn=%~2" & shift)
if "!a!"=="-p" (set "png=1")
if "!a!"=="-wpq" (set "wbp=1" & set "sns=80" & set "wq=80")
if "!a!"=="-wlq" (set "wbp=1" & set "sns=50" & set "wq=85")
if "!a!"=="-wmq" (set "wbp=1" & set "sns=20" & set "wq=90")
if "!a!"=="-w" (set "wbp=1" & set "sns=0" & set "wq=95")
if "!a!"=="-whq" (set "wbp=1" & set "sns=0" & set "wq=99")
if "!a!"=="-jpq" (set "jpg=1" & set "jq=80")
if "!a!"=="-jlq" (set "jpg=1" & set "jq=85")
if "!a!"=="-jmq" (set "jpg=1" & set "jq=90")
if "!a!"=="-j" (set "jpg=1" & set "jq=95")
if "!a!"=="-jhq" (set "jpg=1" & set "jq=99")
if "!a!"=="-rg" (set "cm=rg" & set "cpf=rgr")
if "!a!"=="-cx" (set "cm=cx" & set "cx1=%~2" & set "cx2=%~3" & set "cpf=wth!cx1!t!cx2!" & shift & shift)
if "!a!"=="-cr" (set "cm=cr" & set "cr1=%~2" & set "cr2=%~3" & set "cpf=lts!cr1!t!cr2!" & shift & shift)
if "!a!"=="-gy" (set "cm=gy" & set "cpf=grv")
if "!a!"=="-gx" (set "cm=gx" & set "cpf=grh")
if "!a!"=="-gr" (set "cm=gr" & set "cpf=gr")
if "!a!"=="-sq" (set "cm=sq" & set "cpf=sq")
if "!a!"=="-up" (set "sm=up" & set "sp=%~2" & set "spf=!sp!pc" & shift)
if "!a!"=="-uf" (set "sm=uf" & set "sf1=%~2" & set "sf2=%~3" & set "spf=!sf1!d!sf2!" & shift & shift)
if "!a!"=="-uy" (set "sm=uy" & set "sy=%~2" & set "spf=x!sy!" & shift)
if "!a!"=="-ux" (set "sm=ux" & set "sx=%~2" & set "spf=!sx!x" & shift)
if "!a!"=="-us" (set "sm=us" & set "ss=%~2" & set "spf=s!ss!" & shift)
if "!a!"=="-ul" (set "sm=ul" & set "sl=%~2" & set "spf=l!sl!" & shift)
if "!a!"=="-sp" (set "sm=sp" & set "sp=%~2" & set "spf=!sp!pc" & shift)
if "!a!"=="-sf" (set "sm=sf" & set "sf1=%~2" & set "sf2=%~3" & set "spf=!sf1!d!sf2!" & shift & shift)
if "!a!"=="-sy" (set "sm=sy" & set "sy=%~2" & set "spf=x!sy!" & shift)
if "!a!"=="-sx" (set "sm=sx" & set "sx=%~2" & set "spf=!sx!x" & shift)
if "!a!"=="-ss" (set "sm=ss" & set "ss=%~2" & set "spf=s!ss!" & shift)
if "!a!"=="-sl" (set "sm=sl" & set "sl=%~2" & set "spf=l!sl!" & shift)
) else (
if not defined i set "i=%~1"
for %%f in ("!i!") do set "op=%%~dpf" & set "on=%%~nf"
)
shift
goto a
:p
if "!np!"=="" set "np=!op!"
if not "!np:~-1!"=="\" set "np=!np!\"
if not exist "!np!" md "!np!"
if "!bn!"=="" set "bn=!on!"
if defined cpf set "cpf=-!cpf!"
if defined spf set "spf=-!spf!"
if "!gn!"=="" set "gn=!bn!!cpf!!spf!"
if defined cm (
if "!cm!"=="cx" set "cmb=crop='floor(if(gte(iw/ih,!cx1!/!cx2!),ih*!cx1!/!cx2!,iw)/2)*2:floor(if(gte(iw/ih,!cx1!/!cx2!),ih,iw*!cx2!/!cx1!)/2)*2'"
if "!cm!"=="cr" set "cmb=crop='floor(if(gte(iw,ih),min(iw,ih*(!cr1!/!cr2!)),min(iw,ih*(!cr2!/!cr1!)))/2)*2:floor(if(gte(iw,ih),min(ih,iw*(!cr2!/!cr1!)),min(ih,iw*(!cr1!/!cr2!)))/2)*2'"
if "!cm!"=="rg" set "cmb=crop='floor(if(gte(iw,ih),min(iw,ih*(17711/28657)),min(iw,ih*(28657/17711)))/2)*2:floor(if(gte(iw,ih),min(ih,iw*(28657/17711)),min(ih,iw*(17711/28657)))/2)*2'"
if "!cm!"=="gy" set "cmb=crop='floor(if(gte(iw/ih,17711/28657),ih*17711/28657,iw)/2)*2:floor(if(gte(iw/ih,17711/28657),ih,iw*28657/17711)/2)*2'"
if "!cm!"=="gx" set "cmb=crop='floor(if(gte(iw/ih,28657/17711),ih*28657/17711,iw)/2)*2:floor(if(gte(iw/ih,28657/17711),ih,iw*17711/28657)/2)*2'"
if "!cm!"=="gr" set "cmb=crop='floor(if(gte(iw,ih),min(iw,ih*(28657/17711)),min(iw,ih*(17711/28657)))/2)*2:floor(if(gte(iw,ih),min(ih,iw*(17711/28657)),min(ih,iw*(28657/17711)))/2)*2'"
if "!cm!"=="sq" set "cmb=crop='floor(min(iw,ih)/2)*2:floor(min(iw,ih)/2)*2'"
)
if defined sm (
if "!sm!"=="sp" set "smb=scale='if(lte(!sp!,100),floor(iw*!sp!/100),iw):if(lte(!sp!,100),floor(ih*!sp!/100),ih)'"
if "!sm!"=="sf" set "smb=scale='if(lte(iw*!sf1!/!sf2!,iw),floor(iw*!sf1!/!sf2!),iw):if(lte(ih*!sf1!/!sf2!,ih),floor(ih*!sf1!/!sf2!),ih)'"
if "!sm!"=="sy" set "smb=scale='-2:if(lte(!sy!,ih),!sy!,ih)'"
if "!sm!"=="sx" set "smb=scale='if(lte(!sx!,iw),!sx!,iw):-2'"
if "!sm!"=="ss" set "smb=scale='if(lt(iw,ih),min(!ss!,iw),-2):if(gte(iw,ih),min(!ss!,ih),-2)'"
if "!sm!"=="sl" set "smb=scale='if(gte(iw,ih),min(!sl!,iw),-2):if(lt(iw,ih),min(!sl!,ih),-2)'"
if "!sm!"=="up" set "smb=scale='floor(iw*!sp!/100):floor(ih*!sp!/100)'"
if "!sm!"=="uf" set "smb=scale='floor(iw*!sf1!/!sf2!):floor(ih*!sf1!/!sf2!)'"
if "!sm!"=="uy" set "smb=scale=-2:!sy!"
if "!sm!"=="ux" set "smb=scale=!sx!:-2"
if "!sm!"=="us" set "smb=scale='if(lt(iw,ih),!ss!,-2):if(gte(iw,ih),!ss!,-2)'"
if "!sm!"=="ul" set "smb=scale='if(gte(iw,ih),!sl!,-2):if(lt(iw,ih),!sl!,-2)'"
)
if defined cm if not defined sm (set "vfb=!cmb!")
if not defined cm if defined sm (set "vfb=!smb!")
if defined cm if defined sm (set "vfb=!cmb!,!smb!")
if not defined vfb (
ffmpeg -i "!i!" -vframes:v 1 -update true -compression_level 0 "!op!!on!_intermediateagzk3kXe8nDr.png" -y
) else (
ffmpeg -i "!i!" -vframes:v 1 -update true -compression_level 0 -vf "!vfb!" -sws_flags lanczos+accurate_rnd+full_chroma_inp+full_chroma_int "!op!!on!_intermediateagzk3kXe8nDr.png" -y
)
if "!jpg!"=="1" (
cjpegli -q !jq! --chroma_subsampling=444 "!op!!on!_intermediateagzk3kXe8nDr.png" "!op!!on!_intermediateagzk3kXe8nDr.jpg"
exiftool -overwrite_original -all= "!op!!on!_intermediateagzk3kXe8nDr.jpg"
if "!hg!"=="1" (
move /y "!op!!on!_intermediateagzk3kXe8nDr.jpg" "!np!!gn!.jpg"
) else (
move /y "!op!!on!_intermediateagzk3kXe8nDr.jpg" "!np!!gn!-q!jq!.jpg"
)
)
if "!wbp!"=="1" (
cwebp -mt -q !wq! -m 6 -sharp_yuv -af -alpha_filter best -sns !sns! "!op!!on!_intermediateagzk3kXe8nDr.png" -o "!op!!on!_intermediateagzk3kXe8nDr.webp"
exiftool -overwrite_original -all= "!op!!on!_intermediateagzk3kXe8nDr.webp"
if "!hg!"=="1" (
move /y "!op!!on!_intermediateagzk3kXe8nDr.webp" "!np!!gn!.webp"
) else (
move /y "!op!!on!_intermediateagzk3kXe8nDr.webp" "!np!!gn!-q!wq!.webp"
)
)
if "!png!"=="1" (
optipng -o7 -zm1-9 "!op!!on!_intermediateagzk3kXe8nDr.png"
exiftool -overwrite_original -all= "!op!!on!_intermediateagzk3kXe8nDr.png"
move /y "!op!!on!_intermediateagzk3kXe8nDr.png" "!np!!gn!.png"
) else (
del /q "!op!!on!_intermediateagzk3kXe8nDr.png"
)
endlocal
```
12 天前
回复了 nabanbaba 创建的主题 Linux 双系统 PC 机求推荐
你买 system76 的机子拿回来自己装 Windows 呗。
插一嘴,这个 KDE 上也能用。
一般来说 7z 的压缩率是最高的,但是当把 RAR 的字典加到 7z 的三倍以上时,就有可能开始出现 RAR 的压缩率强过 7z 的情形了——有可能,也不是一定,但如果字典的差距更大,则效果可能会更好。7z 在压缩时,32 GB 的内存只能够用 2 GB 的字典,但 RAR 可以一直选到 16 GB, 这对压一些虚拟机镜像、系统备份镜像来说就很实用了。

我买了 RAR 授权,因为它有两个功能挺实用的,一是 -ep 分 -ep1 -ep2 和 -ep3, 7z 那边目前只有 -spf 和 -spf2 (对应 RAR 的 -ep3 和 -ep2), 但实际上 -ep1 最有用;以及 RAR 有个 -ed, 这个 7z 那边根本没有。当然可以先 for 几个循环把空文件夹都删了,但有个 -ed 开关就更省事嘛。
基因,甚至高度近视可能是伴性遗传的(不是很懂哈,只是说说表象,中学学的那点遗传学全忘了)。我家里父系三代之内的男性几乎全都高度近视(不戴眼镜看啥都看不清,戴上眼镜旁人看着眼睛都小了一圈儿那种,而且都是年轻的时候近视的),而我作为一个「变异体」,从小无论如何不注意用眼习惯也没近视,整天整夜看电脑或者小时候用一个一瓦的小灯泡用手捏着电池和电线然后夜里趴在床上用它看书(看小说)啥的,一点儿事儿没有,如今已经 30 多岁,还是没近视(所以有时候照个大合照什么的我就是那个唯一不戴眼镜的男性)。而我一个同代堂兄弟,他母亲因为懂这个(大学老师),担心他会近视,所以从小就对他用眼习惯特别注意,不让他看电视看电脑超过半小时的那种,然后做作业的时候他妈一直在一边盯着,总是提醒他头太低了抬头云云,但是还是一点儿用没有,仍旧在 10 几岁的某一年里(不到一年的时间)视力迅速退化成了高度近视,好像就是和 OP 差不多时候,初中的某一年?记不清了。

有的时候人生还真是一个围城,我这不戴眼镜的反而觉得戴眼镜的样子挺好的,个个都好像挺有学问的样子,我不戴眼镜就一身蛮气。
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   787 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 25ms · UTC 22:01 · PVG 06:01 · LAX 14:01 · JFK 17:01
Developed with CodeLauncher
♥ Do have faith in what you're doing.