vivo 手机 拍照 特殊jpg格式 批量压缩

news/2025/11/19 4:36:32/文章来源:https://www.cnblogs.com/hhdom/p/19239286

https://github.com/tjko/jpegoptim

Windows (setargv.obj "link option" is needed for wildcards expansion to work)

 

JPEGOPTIM(1)                General Commands Manual               JPEGOPTIM(1)

 

NAME
       jpegoptim - utility to optimize/compress JPEG/JFIF files.

 

SYNOPSIS
       jpegoptim [ options ] [ filenames ]


DESCRIPTION
       jpegoptim  is  used  to  optimize/compress jpeg files.  Program supports lossless optimization,  which is based on optimizing the Huffman tables.  And  so  called  "lossy"  optimization  where in addition to optimizing Huffman tables user can specify upperlimit for image quality. 

       NOTE! By default jpegoptim modifies the input files (if they are  opti-         mized),   to  preserve original files use option -d to specify alternate         directory for saving the optimized files to. 

       Only normal files are optimized (symbolic links and special  files  are         skipped).    Also,   any other hard links to the file being optimized (as         created using link(2)) are unaffected. 

 

OPTIONS
       Options may be either the traditional POSIX one letter options,  or  the         GNU style long options.   POSIX style options start with a single ``-'',          while GNU long options start with ``--''. 

       Options offered by jpegoptim are the following:

       -d<path>, --dest=<path>
             Sets alternative destination directory where  to  save  optimized               files  (default  is to overwrite the originals).  Please note that               unchanged files won't be added to the destination directory.  This               means  if  the  source  file can't be compressed,  no file will be               created in the destination path. 

       -f, --force
             Force optimization, even if the result would be larger  than  the
             original file.

       -h, --help
             Displays short usage information and exits.

       -m<quality>, --max=<quality>
             Sets  the  maximum  image quality factor (disables lossless opti-               mization mode,  which is by default enabled).  This option will re-               duce  quality  of those source files that were saved using higher               quality setting.   While files that  already  have  lower  quality               setting  will  be  compressed  using  the  lossless  optimization               method. 

             Valid values for quality parameter are: 0 - 100

       -n, --noaction
             Don't really optimize files, just print results.

       -S<size>, --size=<size>
             Try to optimize file to given size (disables  lossless  optimiza-               tion  mode).  Target size is specified either in kilobytes (1 n)               or as percentage (1% 99%) of the original file size. 

       -T<threshold>, --threshold=<threshold>
             Keep the file unchanged if the compression gain is lower than the
             threshold (%).

             Valid values for threshold are: 0 - 100

       -w<max>, --workers=<max>
             Set  the maximum number of parallel processes to launch.  (Default               is 1)


       -b, --csv
             Print progress info in CSV format.

       -o, --overwrite
             Overwrite target file even if it exists (when using -d option).

       -p, --preserve
             Preserve file modification times.

       -P, --preserve-perms
             Preserve file permissions (owner/group) by overwriting the origi-               nal file.  This is slightly less safe than the default mode of op-               eration (where new file is first saved as temporary file and then               renamed  over  the  original file).   In this mode a backup of the               original file is made with  . jpegoptim. bak  extension,   and  this               file is removed after the original file has been successfully re-               placed.   NOTE! if running jpegoptim as root there is generally no               need  to  use  this option,  as jpegoptim is able to preserve file               permissions when run by root in default mode. 

       -q, --quiet
             Quiet mode.

       -r, --retry
             Recursively re-try compression until output file  size  does  not
             get  smaller anymore.  This can result a few bytes smaller output
             file, but with the expense of lot more computing time used.

             NOTE! This option is on only effective when used in  compbination
             with -m (--max) or -S (--size) option.

       -t, --totals
             Print totals after processing all files.

       -v, --verbose
             Enables verbose mode (positively chatty).


       --auto-mode
             Select  progressive  vs  non-progressive  mode based on which one               produces smaller output file.  By  default  mode  (progressive  vs               non-progressive) is preserved. 

       --all-normal
             Force all output files to be non-progressive.  Can be used to con-               vert all input files to  non-progressive  JPEGs  when  used  with               --force option. 

       --all-progressive
             Force  all output files to be progressive.  Can be used to convert               all normal (non-progressive) JPEGs  input  files  to  progressive               when used with --force option. Progressive JPEG(渐进式 JPEG):图像在编码时分成多个“扫描(pass)”层。加载时先显示一个整体模糊轮廓,然后随着更多数据到来,图像逐渐变清晰。


       --all-arith
             Force  all output files to use Arithmetic Coding.   This option is               experimental and only available if jpegoptim  was  compiled  with               Arithmetic Coding support enabled. 

       --all-huffman
             Force all output files to use (traditional) Huffman coding.   This               option is experimental and only available if jpegoptim  was  com-               piled with Arithmetic Coding support enabled. 


       --nofix
             Skip  processing of any input files that have any errors/warnings               during decompression.   By default jpegoptim will attempt to opti-               mize  any  file that it is able to decompress,  even if decompres-               sion generates warnings.  This will 'fix' some (corrupt) JPEG  images  automatically.    If this behaviour is not desired,  this op-               tion can be used to make jpegoptim to skip any input  files  that               contain any errors. 


       --save-extra
             Save  extraneous  data  after  end of the JPEG image in the input               file (default is to discard any extraneous data after the end  of               image  that  may  be  present).   This may be useful if JPEG image               contains non-standard extensions that are not part  of  the  JPEG               image  format.   NOTE! This option does not work if input JPEG im-               age is read from standard input (stdin). 

 

       --stdout
             Send output image  to  standard  output.   Note,   if  optimization               didn't  create  smaller  file than the input file,  then no output               original image is passed through  unmodified  (except  any  extra               data after JPEG image will be discarded). 


       --stdin
             Read  input image from standard input and send output to standard               output (--stdout is assumed when this option is used).   When this               option  is  used then only one image is read from standard input.                Any (other) input files specified on  command-line  are  ignored.                Note,  if input file '-' is seen on command line then standard in-               put is also assumed. 


       --files-stdin
             Read names of files to process from standard input. One  filename
             per line.


       --files-from=<filename>
             Read  names  of  files  to  process from a file. One filename per
             line.

 

METADATA OPTIONS
       By default jpegoptim will keep common metadata (JPEG markers) and  dis-         card any other (unknown ones). 

       Following markers are kept by default:
        - EXIF
        - IPTC
        - ICC
        - XMP
        - COM (JPEG Comment markers)

       JFIF  marker  will be regenerated (by libjpeg) during the process (this         cannot be changed).   However,  Adobe marker is also generated (or  omit-         ted)  by libjpeg based on the image colorspace,  etc.   This behavior de-         pends on libjpeg library version being used.  To make sure Adobe  marker         is preserved option --keep-adobe can be used. 

       To  remove  additional markers one or more the --strip-* options can be
       used.

       For example:      --strip-icc --strip-xmp --strip-com


       Alternatively it is possible to specify --strip-all  and  then  one  or
       more of the --keep-* options to explicitly list which markers to keep

       For example:      --strip-all --keep-exif --keep-iptc


       Options for controlling metadata (markers) in output files:


       -s, --strip-all
             Strip  all  markers from output file. (NOTE! by default only Com-
             ment & Exif/IPTC/PhotoShop/ICC/XMP markers are  kept,  everything
             else  is  discarded).  Output JPEG still likely will contains one
             or two markers (JFIF and Adobe  APP14)  depending  on  colorspace
             used  in the image, as these markers are generated by the libjpeg
             encoder automatically.

       --strip-none, --keep-all
             Preserve "all" markers in the image. This will leave all  markers
             untouched  in  the  image,  except  JFIF (APP0) and Adobe (APP14)
             markers as those get regenerated by the libjpeg library.

             NOTE! If this option is specified then  any  other  --strip-*  or
             --keep-* options are ignored.


       --strip-com
             Strip Comment (COM) markers from output file.

       --strip-exif
             Strip EXIF markers from output file.

       --strip-iptc
             Strip IPTC / Adobe Photoshop (APP13) markers from output file.

       --strip-icc
             Strip ICC profiles from output file.

       --strip-xmp
             Strip XMP profiles from output file.

       --strip-jfif
             Strip JFIF markers from output file.

       --strip-jfxx
             Strip JFXX (JFIF Extensions) markers from output file.

       --strip-adobe
             Strip Adobe markers from output file.

 

       --keep-com
             Do not strip any Comment (COM) markers from output file.

       --keep-exif
             Do not strip any EXIF markers from output file.

       --keep-iptc
             Do not strip any IPTC / Adobe Photoshop (APP13) markers from out-
             put file.

       --keep-icc
             Do not strip any ICC profiles from output file.

       --keep-xmp
             Do not strip any XMP profiles from output file.

       --keep-jfif
             Do not strip any JFIF markers from output file.

       --keep-jfxx
             Do not strip any JFXX (JFIF Extensions) markers from output file.

       --keep-adobe
             Do not strip Adobe markers from output file.

 


BUGS
       When using --size option,  resulting file is not always exactly the  re-         quested  size.  Workaround is to re-run jpegoptim on the same file again         which often will result file closer to target size. 


SEE ALSO
       jpeginfo(1)


AUTHOR
       Timo Kokkonen <tjko@iki.fi>


COPYING
       Copyright (C) 1996-2025  Timo Kokkonen

       This program is free software; you can redistribute it and/or modify it
       under  the  terms of the GNU General Public License as published by the
       Free Software Foundation; either version 2 of the License, or (at  your
       option) any later version.

       This  program  is  distributed  in the hope that it will be useful, but
       WITHOUT ANY  WARRANTY;  without  even  the  implied  warranty  of  MER-
       CHANTABILITY  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
       Public License for more details.

       You should have received a copy of the GNU General Public License along
       with this program; if not, write to the Free Software Foundation, Inc.,
       51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

 

4th Berkeley Distribution         28 Jan 2025                     JPEGOPTIM(1)

 

 

 

 

APP 段    标记 (hex)    常见用途
APP0    FFE0    JFIF/缩略图
APP1    FFE1    EXIF, XMP
APP2    FFE2    ICC Profile, FlashPix
APP3    FFE3    厂商自定义 (少见)
APP4    FFE4    厂商自定义
APP5    FFE5    厂商自定义/打印相关
APP6    FFE6    少见,某些标准
APP7    FFE7    厂商自定义
APP8    FFE8    SPIFF 标准 (已过时)
APP9    FFE9    厂商自定义 (MPD 等)
APP10    FFEA    Kodak/HP 相册信息
APP11    FFEB    HDR-JPEG, IPTC/NAA

 

.\jpegoptim.exe .\IMG_20250924_000219_optimtest.jpg

Name                               Length LastWriteTime
----                               ------ -------------
00000000.jpeg                     2167406 2025/11/18 20:52:49    optimtest提取出来的2张
00000724.jpeg                        7854 2025/11/18 20:52:49

IMG_20250924_000219.jpg           3599113 2025/9/23 18:02:22
IMG_20250924_000219_optimtest.jpg 2167406 2025/11/18 16:49:22

 

 

处理前后,大小3.43MB 到2.06MB,打开放大看了一下,像素内容没变化。

 

 

 

Get-ChildItem . | Select-Object Name, Length, LastWriteTime

Name                               Length LastWriteTime
----                               ------ -------------
00000000.jpeg                     2801563 2025/11/18 20:58:57    原图提取出来的5张
00000724.jpeg                        7854 2025/11/18 20:58:57
002abfb3.jpeg                       50274 2025/11/18 20:58:57
002c3b6a.jpeg                      699733 2025/11/18 20:58:57
002c40ea.jpeg                        1213 2025/11/18 20:58:57

 

2801563+7854+50274+699733+1213=3560637


IMG_20250924_000219.jpg           3599113 2025/9/23 18:02:22
IMG_20250924_000219_optimtest.jpg 2167406 2025/11/18 16:49:22

 

 

python jpegdump.py -f -c -e IMG_20250924_000219.jpg

cursor终端里运行会有一段奇怪的重复,不知道为什么,powershell里运行是正常的。

image

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/969549.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

linux cluster

在 Linux 系统中, + #引号 + cluster + #引号 + 通常指的是 集群(Cluster),即一组相互协作的计算机(节点)组成的一个系统,用于提高性能、可靠性、可扩展性等。Linux 系统中,集群技术常用于负载均衡、高可…

linux chrome 下载

在 Linux 系统中,如果你想要下载 Chrome 浏览器,通常有以下几种方法:方法一:使用官方下载链接(推荐) Chrome 浏览器的官方下载地址是: https://www.google.com/chrome/ 你可以直接访问该网站,点击“下载 Chrom…

linux chmod 目录

在 Linux 中,chmod 命令用于修改文件或目录的权限。对于 目录,chmod 的使用方式和文件类似,但需要注意目录的权限设置。? 一、chmod 命令的基本用法 chmod [options] mode file...mode:权限模式,可以是数字或符号…

linux checkout

在 Linux 系统中,checkout 并不是一个标准的命令,它通常与版本控制系统(如 Git)相关。如果你是在使用 Git,checkout 是一个常用的命令,用于切换分支或恢复工作目录。 1. Git 中的 checkout 命令 1.1 切换分支 gi…

linux cer

您提到的“linux cer”可能是输入错误或不完整。如果您是想询问与 Linux 系统 或 Linux 命令 相关的问题,请提供更具体的内容,例如:Linux 命令(如 ls, grep, sort 等) Linux 系统管理(如 systemd, init, cron 等…

linux centos 版本查看

在 CentOS 系统中,查看 Linux 版本(包括内核版本和系统发行版版本)的常用方法如下:方法 1:查看系统发行版版本(CentOS) cat /etc/redhat-release 输出示例: CentOS release 7.9.2009 (Core)方法 2:查看内核版…

linux cdc

您提到的 + #引号 + Linux cdc + #引号 + 可能是指 CDC (Communication Device Class),这是 USB 接口的一个标准类,用于定义 USB 设备与主机之间的通信协议。CDC 类常用于 USB 音频、键盘、鼠标等设备。 如果您…

linux catalina

您提到的 + #引号 + Catalina + #引号 + 可能是指 Apache Tomcat 的一个版本,即 Tomcat 9,也被称为 Catalina 9。在 Linux 系统中,Tomcat 是一个常见的 Java Web 服务器。 如果您是在 Linux 系统中安装、配置…

linux caffe

您提到的 + #引号 + Linux Caffe + #引号 + 可能是指在 Linux 系统上使用 Caffe 深度学习框架进行开发或部署。Caffe 是一个基于 C++ 的深度学习框架,常用于图像分类、目标检测等任务。? 一、Caffe 在 Linux 上…

linux cache buffer

在 Linux 系统中,cache buffer 是一个比较抽象的概念,通常与 内存管理、文件系统缓存 或 内核缓冲区 相关。以下是几个与 Linux 内存和缓存相关的常见命令和概念解释:1. free 命令 用于显示系统内存的使用情况,包括…

Linux c 面试

你好!关于 Linux C 面试,我来为你提供一些常见的面试问题和解答,帮助你准备 Linux C 相关的面试内容。一、Linux C 面试常见问题 1. Linux 系统调用Q1: 什么是 open() 函数?它的参数和返回值是什么?A: open() 是用…

2025年11月美国留学中介实勘推荐:10家靠谱机构清单,附藤校录取密码

2025年11月美国留学中介实勘推荐:10家靠谱机构清单,附藤校录取密码面对美国留学申请的重重关卡——从标化考试规划到文书深度打磨,从背景提升定位到签证政策解读,市场上“保录”“低价”的宣传乱象让人难辨真伪。如…

香港中文大学(深圳) BIO1008 - Chemistry and Life Sciences 生物部分重要单词和短语表

2024年秋学期该课程内容涉及的重要单词和短语表按照字典序排好序了,放在代码框中方便复制2024年秋学期该课程生物部分内容涉及的重要单词和短语表 按照字典序排好序了,放在代码框中方便复制点击查看内容 absorption …

创业圈的认知升级开始了?

本文从创业投资环境变化切入,通过三个典型案例分析传统项目计划书的思维缺陷,详细介绍AI项目计划书生成指令的核心价值和使用方法,帮助创业者实现从经验主义到系统性思维的认知升级,提高融资成功率。11月初,一份创…

香港中文大学(深圳) CSC3001 - Discrete Mathematics 笔记

Proposition 命题 要么为真要么为假,且有确切的真假的一个陈述句 简单的命题可以通过逻辑运算符或其他方式组合起来得到复杂的命题Propositional Logic 命题逻辑 通过逻辑运算符将一些值为真/假的命题组合起来,就得到…

linux c 重启

在 Linux 中,如果你想重启系统,可以使用以下几种常见的命令:1. 使用 reboot 命令 这是最常用的方式,适用于大多数 Linux 发行版。 sudo rebootsudo:需要管理员权限。 reboot:重启系统。2. 使用 shutdown 命令 sh…

OBDSTAR MS50 Basic: 1-Year Update Service – Must-Have for EU/US Car Diagnostics Repairs

Outdated Tools? Meet the OBDSTAR MS50: Your Solution for Reliable Diagnostics & Updates For automotive repair shops and car owners across Europe and America, staying ahead of evolving vehicle tech…

2025年11月美国留学中介排名深度测评:藤校Offer的幕后推手都有哪些特质?

2025年11月美国留学中介排名深度测评:藤校Offer的幕后推手都有哪些特质?美国作为全球教育资源最集中的国家,拥有常春藤盟校、斯坦福、MIT等顶尖学府,但其申请体系复杂、院校偏好多元、签证政策严谨,专业留学中介的…

linux c 调用shell

在 Linux 系统中,c 通常指的是 C 语言,而 Shell 是用于执行命令行操作的脚本语言。如果你是想在 C 语言中调用 Shell 命令,那么可以使用 system() 或 exec() 系列函数来实现。 下面我将分步骤解释如何在 C 语言中调…

Universal 3-Button Flip Remote Key for VW Type – KEYDIY KD B34-3 (5pcs/Lot)

The Universal VW Key Solution: KEYDIY KD B34-3 Flip Remote Key For European and American VW owners and automotive repair professionals, traditional key replacements often come with frustration and high…