Java 将照片转化为回忆中的照片,琉璃般的岁月 | Java工具类

Java 将照片转化为回忆中的照片,琉璃般的岁月 | Java工具类,第1张

Java 将照片转化为回忆中的照片,琉璃般的岁月 | Java工具类

目录

前言

环境依赖

代码

总结


前言

本文提供将图片进行色彩处理的Java工具类,让图片变成回忆中的画面。主要将图片做黑白与褐色的处理,具体的效果往下看吧。

环境依赖

一些工具的依赖,最好加一下。

        
            com.google.guava
            guava
            30.1.1-jre
        
        
            cn.hutool
            hutool-all
            5.5.2
        

ffmpeg环境依赖,需要添加一下。

可以直接参考我的另一篇文章安装:windows ffmpeg安装部署_阿良的博客-CSDN博客

代码

完整工具类代码如下

package ai.guiji.csdn.tools;

import cn.hutool.core.util.IdUtil;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;

import java.io.File;
import java.util.Arrays;
import java.util.List;


public class PictureInMemoryUtil {
  
  public static String blackAndWhite(String imagePath, String outputDir) throws Exception {
    List paths = Splitter.on(".").splitToList(imagePath);
    String ext = paths.get(paths.size() - 1);
    if (!Arrays.asList("png", "jpg").contains(ext)) {
      throw new Exception("format error");
    }
    String resultPath =
        Joiner.on(File.separator).join(Arrays.asList(outputDir, IdUtil.simpleUUID() + "." + ext));
    ProcessBuilder builder =
        new ProcessBuilder(
            "C:\ffpg\bin\ffmpeg.exe",
            "-i",
            imagePath,
            "-vf",
            "colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3",
            "-y",
            resultPath);
    builder.inheritIO().start().waitFor();
    return resultPath;
  }

  
  public static String brown(String imagePath, String outputDir) throws Exception {
    List paths = Splitter.on(".").splitToList(imagePath);
    String ext = paths.get(paths.size() - 1);
    if (!Arrays.asList("png", "jpg").contains(ext)) {
      throw new Exception("format error");
    }
    String resultPath =
        Joiner.on(File.separator).join(Arrays.asList(outputDir, IdUtil.simpleUUID() + "." + ext));
    ProcessBuilder builder =
        new ProcessBuilder(
            "C:\ffpg\bin\ffmpeg.exe",
            "-i",
            imagePath,
            "-vf",
            "colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131",
            "-y",
            resultPath);
    builder.inheritIO().start().waitFor();
    return resultPath;
  }

}

代码说明

1、两个方法分别可以将图片黑白化和褐色化,参数均为:图片地址、输出目录。

2、两个方法中的ffmpeg执行路径,需要填写你安装ffmpeg的ffmpeg.exe所在位置。

3、两个方法均做了格式校验,只有两种,可按照自己的需求添加。

4、为了防止文件名重复,使用uuid作为文件名。

验证一下

下面是我选择的原始图片

验证代码如下

  public static void main(String[] args) throws Exception {
    System.out.println(
        blackAndWhite("C:\Users\huyi\Desktop.jpg", "C:\Users\huyi\Desktop"));
    System.out.println(brown("C:\Users\huyi\Desktop.jpg", "C:\Users\huyi\Desktop"));
  }

 

执行结果

"C:Program FilesJavajdk1.8.0_161binjava.exe" "-javaagent:C:Program FilesJetBrainsIntelliJ IDEA 2020.1.3libidea_rt.jar=14185:C:Program FilesJetBrainsIntelliJ IDEA 2020.1.3bin" -Dfile.encoding=UTF-8 -classpath "C:Program FilesJavajdk1.8.0_161jrelibcharsets.jar;C:Program FilesJavajdk1.8.0_161jrelibdeploy.jar;C:Program FilesJavajdk1.8.0_161jrelibextaccess-bridge-64.jar;C:Program FilesJavajdk1.8.0_161jrelibextcldrdata.jar;C:Program FilesJavajdk1.8.0_161jrelibextdnsns.jar;C:Program FilesJavajdk1.8.0_161jrelibextjaccess.jar;C:Program FilesJavajdk1.8.0_161jrelibextjfxrt.jar;C:Program FilesJavajdk1.8.0_161jrelibextlocaledata.jar;C:Program FilesJavajdk1.8.0_161jrelibextnashorn.jar;C:Program FilesJavajdk1.8.0_161jrelibextsunec.jar;C:Program FilesJavajdk1.8.0_161jrelibextsunjce_provider.jar;C:Program FilesJavajdk1.8.0_161jrelibextsunmscapi.jar;C:Program FilesJavajdk1.8.0_161jrelibextsunpkcs11.jar;C:Program FilesJavajdk1.8.0_161jrelibextzipfs.jar;C:Program FilesJavajdk1.8.0_161jrelibjavaws.jar;C:Program FilesJavajdk1.8.0_161jrelibjce.jar;C:Program FilesJavajdk1.8.0_161jrelibjfr.jar;C:Program FilesJavajdk1.8.0_161jrelibjfxswt.jar;C:Program FilesJavajdk1.8.0_161jrelibjsse.jar;C:Program FilesJavajdk1.8.0_161jrelibmanagement-agent.jar;C:Program FilesJavajdk1.8.0_161jrelibplugin.jar;C:Program FilesJavajdk1.8.0_161jrelibresources.jar;C:Program FilesJavajdk1.8.0_161jrelibrt.jar;D:JavaProjectcsdntargetclasses;C:Usershuyi.m2repositoryorgspringframeworkbootspring-boot-starter-web2.5.5spring-boot-starter-web-2.5.5.jar;C:Usershuyi.m2repositoryorgspringframeworkbootspring-boot-starter2.5.5spring-boot-starter-2.5.5.jar;C:Usershuyi.m2repositoryorgspringframeworkbootspring-boot-starter-logging2.5.5spring-boot-starter-logging-2.5.5.jar;C:Usershuyi.m2repositorychqoslogbacklogback-classic1.2.6logback-classic-1.2.6.jar;C:Usershuyi.m2repositorychqoslogbacklogback-core1.2.6logback-core-1.2.6.jar;C:Usershuyi.m2repositoryorgapachelogginglog4jlog4j-to-slf4j2.14.1log4j-to-slf4j-2.14.1.jar;C:Usershuyi.m2repositoryorgapachelogginglog4jlog4j-api2.14.1log4j-api-2.14.1.jar;C:Usershuyi.m2repositoryorgslf4jjul-to-slf4j1.7.32jul-to-slf4j-1.7.32.jar;C:Usershuyi.m2repositoryjakartaannotationjakarta.annotation-api1.3.5jakarta.annotation-api-1.3.5.jar;C:Usershuyi.m2repositoryorgyamlsnakeyaml1.28snakeyaml-1.28.jar;C:Usershuyi.m2repositoryorgspringframeworkbootspring-boot-starter-json2.5.5spring-boot-starter-json-2.5.5.jar;C:Usershuyi.m2repositorycomfasterxmljacksoncorejackson-databind2.12.5jackson-databind-2.12.5.jar;C:Usershuyi.m2repositorycomfasterxmljacksoncorejackson-annotations2.12.5jackson-annotations-2.12.5.jar;C:Usershuyi.m2repositorycomfasterxmljacksoncorejackson-core2.12.5jackson-core-2.12.5.jar;C:Usershuyi.m2repositorycomfasterxmljacksondatatypejackson-datatype-jdk82.12.5jackson-datatype-jdk8-2.12.5.jar;C:Usershuyi.m2repositorycomfasterxmljacksondatatypejackson-datatype-jsr3102.12.5jackson-datatype-jsr310-2.12.5.jar;C:Usershuyi.m2repositorycomfasterxmljacksonmodulejackson-module-parameter-names2.12.5jackson-module-parameter-names-2.12.5.jar;C:Usershuyi.m2repositoryorgspringframeworkbootspring-boot-starter-tomcat2.5.5spring-boot-starter-tomcat-2.5.5.jar;C:Usershuyi.m2repositoryorgapachetomcatembedtomcat-embed-core9.0.53tomcat-embed-core-9.0.53.jar;C:Usershuyi.m2repositoryorgapachetomcatembedtomcat-embed-el9.0.53tomcat-embed-el-9.0.53.jar;C:Usershuyi.m2repositoryorgapachetomcatembedtomcat-embed-websocket9.0.53tomcat-embed-websocket-9.0.53.jar;C:Usershuyi.m2repositoryorgspringframeworkspring-web5.3.10spring-web-5.3.10.jar;C:Usershuyi.m2repositoryorgspringframeworkspring-beans5.3.10spring-beans-5.3.10.jar;C:Usershuyi.m2repositoryorgspringframeworkspring-webmvc5.3.10spring-webmvc-5.3.10.jar;C:Usershuyi.m2repositoryorgspringframeworkspring-aop5.3.10spring-aop-5.3.10.jar;C:Usershuyi.m2repositoryorgspringframeworkspring-context5.3.10spring-context-5.3.10.jar;C:Usershuyi.m2repositoryorgspringframeworkspring-expression5.3.10spring-expression-5.3.10.jar;C:Usershuyi.m2repositoryorgspringframeworkbootspring-boot-devtools2.5.5spring-boot-devtools-2.5.5.jar;C:Usershuyi.m2repositoryorgspringframeworkbootspring-boot2.5.5spring-boot-2.5.5.jar;C:Usershuyi.m2repositoryorgspringframeworkbootspring-boot-autoconfigure2.5.5spring-boot-autoconfigure-2.5.5.jar;C:Usershuyi.m2repositoryorgspringframeworkbootspring-boot-configuration-processor2.5.5spring-boot-configuration-processor-2.5.5.jar;C:Usershuyi.m2repositoryorgprojectlomboklombok1.18.20lombok-1.18.20.jar;C:Usershuyi.m2repositoryorgspringframeworkspring-core5.3.10spring-core-5.3.10.jar;C:Usershuyi.m2repositoryorgspringframeworkspring-jcl5.3.10spring-jcl-5.3.10.jar;C:Usershuyi.m2repositoryorgjaudiotagger2.0.1jaudiotagger-2.0.1.jar;C:Usershuyi.m2repositorycomgoogleguavaguava30.1.1-jreguava-30.1.1-jre.jar;C:Usershuyi.m2repositorycomgoogleguavafailureaccess1.0.1failureaccess-1.0.1.jar;C:Usershuyi.m2repositorycomgoogleguavalistenablefuture9999.0-empty-to-avoid-conflict-with-guavalistenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;C:Usershuyi.m2repositorycomgooglecodefindbugsjsr3053.0.2jsr305-3.0.2.jar;C:Usershuyi.m2repositoryorgcheckerframeworkchecker-qual3.8.0checker-qual-3.8.0.jar;C:Usershuyi.m2repositorycomgoogleerrorproneerror_prone_annotations2.5.1error_prone_annotations-2.5.1.jar;C:Usershuyi.m2repositorycomgooglej2objcj2objc-annotations1.3j2objc-annotations-1.3.jar;C:Usershuyi.m2repositoryorgbytedecojavacv-platform1.5.5javacv-platform-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecojavacv1.5.5javacv-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecoopenblas.3.13-1.5.5openblas-0.3.13-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecoflycapture2.13.3.31-1.5.5flycapture-2.13.3.31-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecolibfreenect.5.7-1.5.5libfreenect-0.5.7-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecolibfreenect2.2.0-1.5.5libfreenect2-0.2.0-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense1.12.4-1.5.5librealsense-1.12.4-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense22.40.0-1.5.5librealsense2-2.40.0-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecovideoinput.200-1.5.5videoinput-0.200-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5.jar;C:Usershuyi.m2repositoryorgopenjfxjavafx-graphics11javafx-graphics-11.jar;C:Usershuyi.m2repositoryorgopenjfxjavafx-graphics11javafx-graphics-11-win.jar;C:Usershuyi.m2repositoryorgopenjfxjavafx-base11javafx-base-11.jar;C:Usershuyi.m2repositoryorgopenjfxjavafx-base11javafx-base-11-win.jar;C:Usershuyi.m2repositoryorgbytedecoopenblas-platform.3.13-1.5.5openblas-platform-0.3.13-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp-platform1.5.5javacpp-platform-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-android-arm.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-android-arm64.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-android-x86.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-android-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-ios-arm64.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-ios-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-linux-armhf.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-linux-arm64.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-linux-ppc64le.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-linux-x86.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-linux-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-macosx-arm64.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-macosx-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-windows-x86.jar;C:Usershuyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-windows-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoopenblas.3.13-1.5.5openblas-0.3.13-1.5.5-android-arm.jar;C:Usershuyi.m2repositoryorgbytedecoopenblas.3.13-1.5.5openblas-0.3.13-1.5.5-android-arm64.jar;C:Usershuyi.m2repositoryorgbytedecoopenblas.3.13-1.5.5openblas-0.3.13-1.5.5-android-x86.jar;C:Usershuyi.m2repositoryorgbytedecoopenblas.3.13-1.5.5openblas-0.3.13-1.5.5-android-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoopenblas.3.13-1.5.5openblas-0.3.13-1.5.5-ios-arm64.jar;C:Usershuyi.m2repositoryorgbytedecoopenblas.3.13-1.5.5openblas-0.3.13-1.5.5-ios-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoopenblas.3.13-1.5.5openblas-0.3.13-1.5.5-linux-x86.jar;C:Usershuyi.m2repositoryorgbytedecoopenblas.3.13-1.5.5openblas-0.3.13-1.5.5-linux-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoopenblas.3.13-1.5.5openblas-0.3.13-1.5.5-linux-armhf.jar;C:Usershuyi.m2repositoryorgbytedecoopenblas.3.13-1.5.5openblas-0.3.13-1.5.5-linux-arm64.jar;C:Usershuyi.m2repositoryorgbytedecoopenblas.3.13-1.5.5openblas-0.3.13-1.5.5-linux-ppc64le.jar;C:Usershuyi.m2repositoryorgbytedecoopenblas.3.13-1.5.5openblas-0.3.13-1.5.5-macosx-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoopenblas.3.13-1.5.5openblas-0.3.13-1.5.5-windows-x86.jar;C:Usershuyi.m2repositoryorgbytedecoopenblas.3.13-1.5.5openblas-0.3.13-1.5.5-windows-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoopencv-platform4.5.1-1.5.5opencv-platform-4.5.1-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-android-arm.jar;C:Usershuyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-android-arm64.jar;C:Usershuyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-android-x86.jar;C:Usershuyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-android-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-ios-arm64.jar;C:Usershuyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-ios-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-linux-x86.jar;C:Usershuyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-linux-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-linux-armhf.jar;C:Usershuyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-linux-arm64.jar;C:Usershuyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-linux-ppc64le.jar;C:Usershuyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-macosx-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-windows-x86.jar;C:Usershuyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-windows-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoffmpeg-platform4.3.2-1.5.5ffmpeg-platform-4.3.2-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-android-arm.jar;C:Usershuyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-android-arm64.jar;C:Usershuyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-android-x86.jar;C:Usershuyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-android-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-linux-x86.jar;C:Usershuyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-linux-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-linux-armhf.jar;C:Usershuyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-linux-arm64.jar;C:Usershuyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-linux-ppc64le.jar;C:Usershuyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-macosx-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-windows-x86.jar;C:Usershuyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-windows-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoflycapture-platform2.13.3.31-1.5.5flycapture-platform-2.13.3.31-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecoflycapture2.13.3.31-1.5.5flycapture-2.13.3.31-1.5.5-linux-x86.jar;C:Usershuyi.m2repositoryorgbytedecoflycapture2.13.3.31-1.5.5flycapture-2.13.3.31-1.5.5-linux-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoflycapture2.13.3.31-1.5.5flycapture-2.13.3.31-1.5.5-linux-armhf.jar;C:Usershuyi.m2repositoryorgbytedecoflycapture2.13.3.31-1.5.5flycapture-2.13.3.31-1.5.5-linux-arm64.jar;C:Usershuyi.m2repositoryorgbytedecoflycapture2.13.3.31-1.5.5flycapture-2.13.3.31-1.5.5-windows-x86.jar;C:Usershuyi.m2repositoryorgbytedecoflycapture2.13.3.31-1.5.5flycapture-2.13.3.31-1.5.5-windows-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecolibdc1394-platform2.2.6-1.5.5libdc1394-platform-2.2.6-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5-linux-x86.jar;C:Usershuyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5-linux-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5-linux-armhf.jar;C:Usershuyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5-linux-arm64.jar;C:Usershuyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5-linux-ppc64le.jar;C:Usershuyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5-macosx-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5-windows-x86.jar;C:Usershuyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5-windows-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecolibfreenect-platform.5.7-1.5.5libfreenect-platform-0.5.7-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecolibfreenect.5.7-1.5.5libfreenect-0.5.7-1.5.5-linux-x86.jar;C:Usershuyi.m2repositoryorgbytedecolibfreenect.5.7-1.5.5libfreenect-0.5.7-1.5.5-linux-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecolibfreenect.5.7-1.5.5libfreenect-0.5.7-1.5.5-linux-armhf.jar;C:Usershuyi.m2repositoryorgbytedecolibfreenect.5.7-1.5.5libfreenect-0.5.7-1.5.5-linux-arm64.jar;C:Usershuyi.m2repositoryorgbytedecolibfreenect.5.7-1.5.5libfreenect-0.5.7-1.5.5-linux-ppc64le.jar;C:Usershuyi.m2repositoryorgbytedecolibfreenect.5.7-1.5.5libfreenect-0.5.7-1.5.5-macosx-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecolibfreenect.5.7-1.5.5libfreenect-0.5.7-1.5.5-windows-x86.jar;C:Usershuyi.m2repositoryorgbytedecolibfreenect.5.7-1.5.5libfreenect-0.5.7-1.5.5-windows-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecolibfreenect2-platform.2.0-1.5.5libfreenect2-platform-0.2.0-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecolibfreenect2.2.0-1.5.5libfreenect2-0.2.0-1.5.5-linux-x86.jar;C:Usershuyi.m2repositoryorgbytedecolibfreenect2.2.0-1.5.5libfreenect2-0.2.0-1.5.5-linux-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecolibfreenect2.2.0-1.5.5libfreenect2-0.2.0-1.5.5-macosx-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecolibfreenect2.2.0-1.5.5libfreenect2-0.2.0-1.5.5-windows-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense-platform1.12.4-1.5.5librealsense-platform-1.12.4-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense1.12.4-1.5.5librealsense-1.12.4-1.5.5-linux-armhf.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense1.12.4-1.5.5librealsense-1.12.4-1.5.5-linux-arm64.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense1.12.4-1.5.5librealsense-1.12.4-1.5.5-linux-x86.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense1.12.4-1.5.5librealsense-1.12.4-1.5.5-linux-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense1.12.4-1.5.5librealsense-1.12.4-1.5.5-macosx-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense1.12.4-1.5.5librealsense-1.12.4-1.5.5-windows-x86.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense1.12.4-1.5.5librealsense-1.12.4-1.5.5-windows-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense2-platform2.40.0-1.5.5librealsense2-platform-2.40.0-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense22.40.0-1.5.5librealsense2-2.40.0-1.5.5-linux-armhf.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense22.40.0-1.5.5librealsense2-2.40.0-1.5.5-linux-arm64.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense22.40.0-1.5.5librealsense2-2.40.0-1.5.5-linux-x86.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense22.40.0-1.5.5librealsense2-2.40.0-1.5.5-linux-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense22.40.0-1.5.5librealsense2-2.40.0-1.5.5-macosx-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense22.40.0-1.5.5librealsense2-2.40.0-1.5.5-windows-x86.jar;C:Usershuyi.m2repositoryorgbytedecolibrealsense22.40.0-1.5.5librealsense2-2.40.0-1.5.5-windows-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecovideoinput-platform.200-1.5.5videoinput-platform-0.200-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecovideoinput.200-1.5.5videoinput-0.200-1.5.5-windows-x86.jar;C:Usershuyi.m2repositoryorgbytedecovideoinput.200-1.5.5videoinput-0.200-1.5.5-windows-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoartoolkitplus-platform2.3.1-1.5.5artoolkitplus-platform-2.3.1-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-android-arm.jar;C:Usershuyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-android-arm64.jar;C:Usershuyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-android-x86.jar;C:Usershuyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-android-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-linux-x86.jar;C:Usershuyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-linux-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-linux-armhf.jar;C:Usershuyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-linux-arm64.jar;C:Usershuyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-linux-ppc64le.jar;C:Usershuyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-macosx-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-windows-x86.jar;C:Usershuyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-windows-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoflandmark-platform1.07-1.5.5flandmark-platform-1.07-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-android-arm.jar;C:Usershuyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-android-arm64.jar;C:Usershuyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-android-x86.jar;C:Usershuyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-android-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-linux-x86.jar;C:Usershuyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-linux-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-linux-armhf.jar;C:Usershuyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-linux-arm64.jar;C:Usershuyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-linux-ppc64le.jar;C:Usershuyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-macosx-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-windows-x86.jar;C:Usershuyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-windows-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoleptonica-platform1.80.0-1.5.5leptonica-platform-1.80.0-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-android-arm.jar;C:Usershuyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-android-arm64.jar;C:Usershuyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-android-x86.jar;C:Usershuyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-android-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-linux-x86.jar;C:Usershuyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-linux-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-linux-armhf.jar;C:Usershuyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-linux-arm64.jar;C:Usershuyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-linux-ppc64le.jar;C:Usershuyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-macosx-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-windows-x86.jar;C:Usershuyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-windows-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecotesseract-platform4.1.1-1.5.5tesseract-platform-4.1.1-1.5.5.jar;C:Usershuyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-android-arm.jar;C:Usershuyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-android-arm64.jar;C:Usershuyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-android-x86.jar;C:Usershuyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-android-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-linux-x86.jar;C:Usershuyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-linux-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-linux-armhf.jar;C:Usershuyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-linux-arm64.jar;C:Usershuyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-linux-ppc64le.jar;C:Usershuyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-macosx-x86_64.jar;C:Usershuyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-windows-x86.jar;C:Usershuyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-windows-x86_64.jar;C:Usershuyi.m2repositorycomgithubatoolfluent-mybatis1.8.7fluent-mybatis-1.8.7.jar;C:Usershuyi.m2repositoryjavaxannotationjavax.annotation-api1.3.2javax.annotation-api-1.3.2.jar;C:Usershuyi.m2repositoryorgmybatismybatis-spring2.0.6mybatis-spring-2.0.6.jar;C:Usershuyi.m2repositorycomgithubatooldb-feature1.3.4db-feature-1.3.4.jar;C:Usershuyi.m2repositoryorgmybatismybatis3.5.7mybatis-3.5.7.jar;C:Usershuyi.m2repositorymysqlmysql-connector-java8.0.26mysql-connector-java-8.0.26.jar;C:Usershuyi.m2repositoryorgmp4parserisoparser1.9.41isoparser-1.9.41.jar;C:Usershuyi.m2repositoryorgslf4jslf4j-api1.7.32slf4j-api-1.7.32.jar;C:Usershuyi.m2repositorycnhutoolhutool-all5.5.2hutool-all-5.5.2.jar;C:Usershuyi.m2repositoryorgjava-websocketJava-WebSocket1.5.1Java-WebSocket-1.5.1.jar" ai.guiji.csdn.tools.PictureInMemoryUtil
ffmpeg version n4.3.1-20-g8a2acdc6da Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3-win32 (GCC) 20200320
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --enable-iconv --enable-zlib --enable-libxml2 --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvmaf --disable-vulkan --enable-libvorbis --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-ffnvcodec --enable-cuda-llvm --disable-libglslang --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libtwolame --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-libs=-lgomp
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, image2, from 'C:UsershuyiDesktop5.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 148025 kb/s
    Stream #0:0: Video: mjpeg (baseline), yuvj444p(pc, bt470bg/unknown/unknown), 2560x1440, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 000002b35c984980] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 000002b35c9e8e80] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'C:UsershuyiDesktopfcab150db17244b4b3b5dc3b4c8e89f1.jpg':
  metadata:
    encoder         : Lavf58.45.100
    Stream #0:0: Video: mjpeg, yuvj444p(pc), 2560x1440, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    metadata:
      encoder         : Lavc58.91.100 mjpeg
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame=    1 fps=0.0 q=9.3 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=0.128x    
video:188kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
C:UsershuyiDesktopfcab150db17244b4b3b5dc3b4c8e89f1.jpg
ffmpeg version n4.3.1-20-g8a2acdc6da Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3-win32 (GCC) 20200320
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --enable-iconv --enable-zlib --enable-libxml2 --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvmaf --disable-vulkan --enable-libvorbis --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-ffnvcodec --enable-cuda-llvm --disable-libglslang --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libtwolame --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-libs=-lgomp
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, image2, from 'C:UsershuyiDesktop5.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 148025 kb/s
    Stream #0:0: Video: mjpeg (baseline), yuvj444p(pc, bt470bg/unknown/unknown), 2560x1440, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 00000165f6356180] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 00000165f63ba6c0] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'C:UsershuyiDesktop1481330fb90b4608b5af003ab573b089.jpg':
  metadata:
    encoder         : Lavf58.45.100
    Stream #0:0: Video: mjpeg, yuvj444p(pc), 2560x1440, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    metadata:
      encoder         : Lavc58.91.100 mjpeg
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame=    1 fps=0.0 q=10.1 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=0.171x    
video:236kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
C:UsershuyiDesktop1481330fb90b4608b5af003ab573b089.jpg

Process finished with exit code 0

黑白化效果图如下

褐色化效果图如下

 

 是不是有小时候的味道。

总结

没什么好总结的。

分享:

        人一经长大,那一切就成为身外之物,不必让种种记忆永远和自己同在,就让它留在它形成的地方吧。——《物质生活》

如果本文对你有用的话,请不要吝啬你的赞,谢谢!

  

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5562458.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-14
下一篇 2022-12-14

发表评论

登录后才能评论

评论列表(0条)

保存