Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques Batch denoising JPEG files with ffmpeg

  • Batch denoising JPEG files with ffmpeg

    Posted by Chiq Garcia on January 22, 2014 at 11:13 am

    I love PhotoScape! If your photoshop skills are not up to par, then you will like this program too. Its ‘film effect’ filters are amazing, but what I really like about this program is its Noise Reduction (clear skin) feature – your woman will love you for using it, especially on close-ups (less visible blemishes/pores/lines). Unfortunately, this functionality is not available in batch editor mode (last time I checked). *sigh*

    Since this is an ffmpeg forum, you’ve probably figured out what I’m driving at… yes, ffmpeg offers the next best thing, and it’s called High Quality 3D Denoise.

    Just create an empty text file, rename it to, like, “Denoise_JPEG_files_in_this_folder.bat”, copy/paste the code below, set the appropriate ffmpeg path, tweak to taste, copy/paste the batch file into a folder full of jpeg files, and you’re ready to go!

    BTW, set the value for “AdditionalVideoFilters” to blank if you don’t want the ‘vintage’ look.

    @echo off

    : _______________________________________________

    : This batch file will apply ffmpeg's High Quality 3D Denoise filter on all found image files in the current folder (subfolders included) and open the output folder. Don't forget to set ffmpeg's full path.

    : _______________________________________________

    : enter required/desired settings

    : set ffmpeg path (required). use double quotes.
    set ffmpeg="C:\~ En Masse\third party bin\ffmpeg-20131222-git-9b195dd-win32-static\bin\ffmpeg.exe"

    : set denoise strength. practical range for a 640x480 image is 4-12. no quotes.
    set DenoiseStrength=12

    : set image file types to search/process. note that all files will be converted to the set outputfile extension. no quotes.
    set FileTypes=*.jpg, *.jpeg, *.bmp, *.png, *.tif, *.tiff

    : output folder (subfolder). no quotes/spaces.
    set OutputFolder=~Denoised

    : output file name suffix. no quotes.
    set Suffix=_Denoised

    : output file extension (jpg, png, bmp, etc). no quotes.
    set OutputExtension=jpg

    : additional video filter (optional). this is for demonstration purposes only. precede each filter with a comma ','. you can set the value to blank if you don't want this feature. no double quotes at both ends.
    set AdditionalVideoFilters=, curves=r='0/0.11 .42/.51 1/0.95':g='0.50/0.48':b='0/0.22 .49/.44 1/0.8'

    : _______________________________________________

    title %~n0

    : create the output folder
    md %OutputFolder%

    : open the created output folder
    start explorer.exe %OutputFolder%

    : search and process
    FOR /F "delims=" %%A IN ('dir /a:-d /b /o:n /s %FileTypes%') DO (
    echo %%A
    %ffmpeg% -threads 1 -y -f image2 -i "%%A" -f image2 -qscale:v 1 -vf "hqdn3d=luma_spatial=%DenoiseStrength%: chroma_spatial=1: luma_tmp=1: chroma_tmp=1 %AdditionalVideoFilters%" "%OutputFolder%\%%~nA%Suffix%.%OutputExtension%"
    )

    exit

    En Masse ~ batch processor for videos
    https://www.youtube.com/watch?v=6pSH8lQZpRQ

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

    Chiq Garcia replied 12 years, 3 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy