여러 폴더의 이미지를 PNG8로 일괄 변환하려면 어떻게 해야 합니까?

여러 폴더의 이미지를 PNG8로 일괄 변환하려면 어떻게 해야 합니까?

20개 이상의 폴더에 4500개 이상의 PNG 24 이미지가 있는데 이를 PNG 8로 변환하여 크기를 줄이고 싶습니다. (참고: 스머싱 및 기타 png 최적화를 시도했지만 절약 효과가 충분하지 않습니다. PS의 2개 폴더에서는 PNG 8이 이미지의 심각한 저하가 없어야 함을 보여주었습니다.)

PS CS3 배치를 시도했을 때 원본 위에 저장되지 않았고 생성된 새 파일에는 폴더 구조가 없습니다. 이 작업을 위한 도구나 다른 도구를 고칠 수 있는 방법이 있나요?

저는 OSX를 실행하고 있지만 Windows XP/7에 액세스할 수 있습니다.

답변1

XnView일괄 처리/변환을 처리합니다. Ctrl+ U: "도구 -> 일괄 처리..."

  • 덮어쓰기, 원래 경로 사용(출력으로) 및/또는 하위 폴더 구조 유지 옵션.
  • 변환 탭에서 "변환 > 색상으로 변환" 변환을 추가합니다. 매개변수 중 하나는 비트/픽셀입니다.

답변2

그거 정말 고통스럽지 않나요? 여기에 비결이 있습니다. 작업을 기록하여 png8로 만든 후 작업 팔레트의 오른쪽 상단을 클릭하고 삽입 메뉴 항목을 선택합니다. 그런 다음 파일 --> 저장을 클릭하세요. 확인을 클릭하세요. 이제 작업 내의 마지막 하위 항목이 됩니다.

이제 배치를 실행하면 예상대로 항목이 하위 폴더에 유지됩니다.

답변3

ImageMagick을 설치하고 Powershell로 실행

 
#--------------------------------------------------------------------

# Powershell script to recursively convert image formats
# Configuration
$srcfolder = "C:\test\Animals"
$destfolder = "C:\test\Animals"
#This ps1 file will add copy files to designated folder
#Do NOT use Mogrify or the original images will be deleted
$im_convert_exe = "convert.exe -density 300"
# with VECTOR files the density setting should come BEFORE the vector file
# or the image will be blurry.
# change src_filter to the format of the source files
$src_filter = "*.eps"
# change dest_ext to the format of the destination files
$dest_ext = "png"
$options = "-depth 8 -alpha off"
$logfile = "C:\temp\convert.log"
$fp = New-Item -ItemType file $logfile -force
$count=0
foreach ($srcitem in $(Get-ChildItem $srcfolder -include $src_filter -recurse))
{
    $srcname = $srcitem.fullname

    # Construct the filename and filepath for the output
    $partial = $srcitem.FullName.Substring( $srcfolder.Length )
    $destname = $destfolder + $partial
    $destname= [System.IO.Path]::ChangeExtension( $destname , $dest_ext )
    $destpath = [System.IO.Path]::GetDirectoryName( $destname )

    # Create the destination path if it does not exist
    if (-not (test-path $destpath))
    {
        New-Item $destpath -type directory | Out-Null
    }

    # Perform the conversion by calling an external tool
    $cmdline =  $im_convert_exe + " `"" + $srcname  + "`"" + $options + " `"" + $destname + "`" " 
    #echo $cmdline
    invoke-expression -command $cmdline

    # Get information about the output file    
    $destitem = Get-item $destname

    # Show and record information comparing the input and output files
    $info = [string]::Format( "{0} `t {1} `t {2} `t {3} `t {4} `t {5}", $count, 
    $partial, $srcname, $destname, $srcitem.Length ,  $destitem.Length)
    echo $info
    Add-Content $fp $info

    $count=$count+1
} 

#--------------------------------------------------------------

 

관련 정보