Инструменты пользователя

Инструменты сайта


progs:photo-soft

ImageMagick

Решение проблем

magick.exe: TIFF: negative image positions unsupported

Tif can't store negative offsets, so +repage is the usual cure for this.

Задачи

Конвертация bmp → jpg и запись комментариев внутрь jpg из текстового файла

Для PS7 и новее.

$folder = "C:\Users\jjj\Pictures\Альбом"
$info = gc "$folder\!Альбом.txt" -encoding 1251
cd $folder
 
# Качество 2-31, меньше лучше, но больше по размеру
dir $folder -Filter "*.bmp" |ForEach-Object -Parallel {
& ffmpeg -i "$($_.fullname)" -q:v 3 "$($_.basename).jpg"
} -ThrottleLimit $env:NUMBER_OF_PROCESSORS
 
# Пропись комментариев
$jpgs = dir "$folder" -Filter "*.jpg"
$info |% {
    & "C:\scripts\ImageMagick\mogrify.exe" -comment "$($_ -replace '^\d+-?\d? - ')" "$(($jpgs |? name -match ($_ -split ' - ')[0]).FullName)"
} 

https://stackoverflow.com/questions/28025017/how-to-store-description-in-jpeg-image

Пример содержимого текстового файла:

762 - Фото 26/X - 52 г. На память тете и дяде и сестре Любе от племянника Вовы.
763 - Чуркино, июнь 1952 г.
764 - Иван, родной брат Марии. 1915 г.
767-2 - Александра Павловна с мужем
769-2 - Лидия Павловна

Имена сканов:

img689.bmp
img690.bmp
img691.bmp
img692-1.bmp
img692-2.bmp
img692-3.bmp

RAW -> JPG

# Изменять размер только если картинка больше 1920 по какой-либо из сторон. Пропорции сохраняются.
# Учитывать ориентацию (чтобы jpg не были перевёрнутыми).
dir *.arw |% {
& magick.exe $_.fullname -auto-orient -resize 1920x1920> -quality 51 "D:\temp\in\ARW\$($_.basename).jpg"
}

JPG -> PDF

### Сканы паспорта
cd "C:\temp\passport"
# Нужны не все файлы в папке, иначе можно было бы указать *.bmp для magick.exe
$files = dir *.bmp |? basename -match 'img12[1-9]'
# 150 dpi, формат А4 (210x297mm / 8.27x11.69in / 595x842pt), поля 300 пикселей, jpeg-сжатие качеством 70
$dpi = 150
$a4 = "$(8.27*$dpi)x$(11.69*$dpi)"
 
& "C:\scripts\ImageMagick\magick.exe" `
$files.name -bordercolor white -border 300 `
-resize $a4 -gravity center -extent $a4 `
-compress jpeg -quality 70 `
"C:\temp\output$dpi.pdf"

https://acavalin.com/p/images_to_a4pdf

Вариант с GhostScript. Не так удобно, как с imagick: конвертировать в jpg и делать список входящих файлов надо заранее, поля не задаются.

cd "C:\temp\passport"
$jpgs = ((dir *.jpg).name |% { "`($_`) viewJPEG showpage" }) -join ' '
 
& 'C:\scripts\Ghostscript\bin\gswin64c.exe' `
-dNOSAFER -dNOPAUSE -dBATCH `
-sPAPERSIZE=a4 -sDEVICE=pdfwrite -o C:\temp\output.pdf `
C:\scripts\Ghostscript\lib\viewjpeg.ps `
-c "$jpgs"

DjVuLibre

djvu -> tiff

Каждая страница в отдельный файл

& "C:\Program Files (x86)\DjVuLibre\ddjvu.exe" -format=tiff -eachpage -skip `
"C:\temp\in\U_himii_svoi_zakonyi.djvu" "c:\temp\in\U_himii_svoi_zakonyi%03d.tiff"

Gimp

Resynthesizer / Heal selection

As an alternative for Windows, one from samj who make a portable gimp 2.10, same code but a more recent compile. Updated to partha versions

One thing that has been updated for Gimp 2.10 is the heal-selection.py plugin. The old one still works although newer version has updated some deprecated procedures.

64 bit version attached. Unzip, replace the existing, wherever you installed them. (~\AppData\Roaming\GIMP\2.10\plug-ins)

I suspect that it might be more than just an old-version problem.

Edit: Added an updated version
Edit: The samj version is 0.16c The Partha version is version 2 There is a difference in the resythesize-gui but not in functionality. For use with the 'heal-python plugins either work.
Edit: Some asking about the other plugins. If you need more than the two 'heal' plugins download the plugins zip.

Example of installation: https://youtu.be/JCbrXqVgttY 2 minutes, no audio

resynth.zip
resynth-partha.zip
resynth-python-plugins.zip

https://www.gimp-forum.net/Thread-Resynthisizer-Heal-Selection-Runtime-Error?pid=12687#pid12687

progs/photo-soft.txt · Последнее изменение: viacheslav

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki