2017-05-22 24 views
0

ImageMagick 및 Ghostscript를 사용하여 TIFF 이미지에서 PDF 파일을 만듭니다.Ghostscript 및 ImageMagick을 사용하여 채널당 16 비트 (48 비트) TIFF 이미지를 PDF 또는 PDF/A로 변환하십시오.

내 소스 티파니는 채널 당 16 비트이고 첨부 된 ICC 프로파일 (AdobeRGB)이있는 알파 (48 비트 이미지)가 없으므로이 파일을 최종 PDF로 유지하려고합니다.

convert input.tif[0] -density 600 -alpha Off -size 5809x9408 -depth 16 intermediate.ps 

이것은 내 입력 TIFF 이미지 (다만, 주 화상 및 [0]을 사용하지 통하여 섬네일) 및 비트 맵으로부터 생성하는 파일 .PS 걸린다.

포스트 스크립트 파일의 크기를 보면 소스 TIFF와 대략 같은 크기 (328MB tiff보다 3 ~ 4MB 더 큼)이지만 .ps의 이미지 데이터 채널당 8 또는 16 비트입니다.

그런 다음 GhostScript를 사용하여 이것을 PDF로 변환하면 PDF에서 채널당 8 비트를 얻게됩니다.

gs -dPDFA=1 -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sDefaultRGBProfile=AdobeRGB1998.icc -dOverrideICC -sOutputFile=output.pdf -r600 -P PDFA_def.ps -f custom.joboptions intermediate.ps 

pdfimages를 사용하여 PDF를 검사하면 채널 당 8 비트를 표시합니다.

%! 
% This is a sample prefix file for creating a PDF/A document. 
% Feel free to modify entries marked with "Customize". 
% This assumes an ICC profile to reside in the file (ISO Coated sb.icc), 
% unless the user modifies the corresponding line below. 

% Define entries in the document Info dictionary : 
/ICCProfile (AdobeRGB1998.icc) % Customise 
def 

[ /Title (Title)  % Customise 
    /DOCINFO pdfmark 

% Define an ICC profile : 

[/_objdef {icc_PDFA} /type /stream /OBJ pdfmark 
[{icc_PDFA} 
<< 
    /N currentpagedevice /ProcessColorModel known { 
    currentpagedevice /ProcessColorModel get dup /DeviceGray eq 
    {pop 1} { 
     /DeviceRGB eq 
     {3}{4} ifelse 
    } ifelse 
    } { 
    (ERROR, unable to determine ProcessColorModel) == flush 
    } ifelse 
>> /PUT pdfmark 
[{icc_PDFA} ICCProfile (r) file /PUT pdfmark 

% Define the output intent dictionary : 

[/_objdef {OutputIntent_PDFA} /type /dict /OBJ pdfmark 
[{OutputIntent_PDFA} << 
    /Type /OutputIntent    % Must be so (the standard requires). 
    /S /GTS_PDFA1     % Must be so (the standard requires). 
    /DestOutputProfile {icc_PDFA}   % Must be so (see above). 
    /OutputConditionIdentifier (sRGB)  % Customize 
>> /PUT pdfmark 
[{Catalog} <</OutputIntents [ {OutputIntent_PDFA} ]>> /PUT pdfmark 

나는 또한 custom.joboptions 파일을 가지고 : 내 PDFA_def.ps의

pdfimages -list output.pdf 

page num type width height color comp bpc enc interp object ID x-ppi y-ppi size ratio 
-------------------------------------------------------------------------------------------- 
    1  0 image 5809 9408 rgb  3 8 image no  10 0 600 600 74.1M 47% 

내용은 고스트 스크립트는 컬러 프로파일로 (1998)에서 AdobeRGB를 지정하는 기본 설치에서 수정되었습니다 Acrobat Distiller에서 만든 다음 PDF/A 호환을 위해 수정했습니다.이 파일에서도 16 비트 이미지를 강제 적용하려고 시도했지만 여전히 PDF에서 8 비트 이미지를 얻고 있습니다.

고스트 스크립트가 사용하는 옵션의 수와 무시할 수있는 옵션의 수를 알 수는 없습니다. PDF를 만들 때이 custom.joboptions 파일을 사용하지 않으면 이미지가 매우 낮은 해상도로 다운 샘플링됩니다. 컴포넌트 당 16 비트를 처리 할 수 ​​

<< 
    /ASCII85EncodePages false 
    /AllowTransparency false 
    /AutoPositionEPSFiles true 
    /AutoRotatePages /All 
    /Binding /Left 
    /CalGrayProfile (Dot Gain 20%) 
    /CalRGBProfile (sRGB IEC61966-2.1) 
    /CalCMYKProfile (U.S. Web Coated \050SWOP\051 v2) 
    /sRGBProfile (sRGB IEC61966-2.1) 
    /CannotEmbedFontPolicy /Error 
    /CompatibilityLevel 1.4 
    /CompressObjects /Off 
    /CompressPages true 
    /ConvertImagesToIndexed true 
    /PassThroughJPEGImages true 
    /CreateJobTicket false 
    /DefaultRenderingIntent /Default 
    /DetectBlends true 
    /DetectCurves 0.0000 
    /ColorConversionStrategy /LeaveColorUnchanged 
    /DoThumbnails false 
    /EmbedAllFonts true 
    /EmbedOpenType false 
    /ParseICCProfilesInComments true 
    /EmbedJobOptions false 
    /DSCReportingLevel 0 
    /EmitDSCWarnings false 
    /EndPage -1 
    /ImageMemory 1048576 
    /LockDistillerParams true 
    /MaxSubsetPct 100 
    /Optimize false 
    /OPM 1 
    /ParseDSCComments true 
    /ParseDSCCommentsForDocInfo true 
    /PreserveCopyPage true 
    /PreserveDICMYKValues true 
    /PreserveEPSInfo true 
    /PreserveFlatness true 
    /PreserveHalftoneInfo false 
    /PreserveOPIComments false 
    /PreserveOverprintSettings false 
    /StartPage 1 
    /SubsetFonts false 
    /TransferFunctionInfo /Apply 
    /UCRandBGInfo /Remove 
    /UsePrologue false 
    /ColorSettingsFile (None) 
    /AlwaysEmbed [ true 
    ] 
    /NeverEmbed [ true 
    ] 
    /AntiAliasColorImages false 
    /CropColorImages true 
    /ColorImageMinResolution 600 
    /ColorImageMinResolutionPolicy /OK 
    /DownsampleColorImages false 
    /ColorImageDownsampleType /Average 
    /ColorImageResolution 600 
    /ColorImageDepth -1 
    /ColorImageMinDownsampleDepth 16 
    /ColorImageDownsampleThreshold 1.50000 
    /EncodeColorImages true 
    /ColorImageFilter /FlateEncode 
    /AutoFilterColorImages false 
    /ColorImageAutoFilterStrategy /JPEG 
    /ColorACSImageDict << 
    /QFactor 0.15 
    /HSamples [1 1 1 1] /VSamples [1 1 1 1] 
    >> 
    /ColorImageDict << 
    /QFactor 0.15 
    /HSamples [1 1 1 1] /VSamples [1 1 1 1] 
    >> 
    /JPEG2000ColorACSImageDict << 
    /TileWidth 256 
    /TileHeight 256 
    /Quality 30 
    >> 
    /JPEG2000ColorImageDict << 
    /TileWidth 256 
    /TileHeight 256 
    /Quality 30 
    >> 
    /AntiAliasGrayImages false 
    /CropGrayImages true 
    /GrayImageMinResolution 300 
    /GrayImageMinResolutionPolicy /OK 
    /DownsampleGrayImages false 
    /GrayImageDownsampleType /Average 
    /GrayImageResolution 600 
    /GrayImageDepth -1 
    /GrayImageMinDownsampleDepth 2 
    /GrayImageDownsampleThreshold 1.50000 
    /EncodeGrayImages true 
    /GrayImageFilter /FlateEncode 
    /AutoFilterGrayImages false 
    /GrayImageAutoFilterStrategy /JPEG 
    /GrayACSImageDict << 
    /QFactor 0.15 
    /HSamples [1 1 1 1] /VSamples [1 1 1 1] 
    >> 
    /GrayImageDict << 
    /QFactor 0.15 
    /HSamples [1 1 1 1] /VSamples [1 1 1 1] 
    >> 
    /JPEG2000GrayACSImageDict << 
    /TileWidth 256 
    /TileHeight 256 
    /Quality 30 
    >> 
    /JPEG2000GrayImageDict << 
    /TileWidth 256 
    /TileHeight 256 
    /Quality 30 
    >> 
    /AntiAliasMonoImages false 
    /CropMonoImages true 
    /MonoImageMinResolution 1200 
    /MonoImageMinResolutionPolicy /OK 
    /DownsampleMonoImages false 
    /MonoImageDownsampleType /Average 
    /MonoImageResolution 2400 
    /MonoImageDepth -1 
    /MonoImageDownsampleThreshold 1.50000 
    /EncodeMonoImages true 
    /MonoImageFilter /CCITTFaxEncode 
    /MonoImageDict << 
    /K -1 
    >> 
    /AllowPSXObjects false 
    /CheckCompliance [ 
    /PDFA1B:2005 
    ] 
    /PDFX1aCheck false 
    /PDFX3Check false 
    /PDFXCompliantPDFOnly true 
    /PDFXNoTrimBoxError false 
    /PDFXTrimBoxToMediaBoxOffset [ 
    0.00000 
    0.00000 
    0.00000 
    0.00000 
    ] 
    /PDFXSetBleedBoxToMediaBox true 
    /PDFXBleedBoxToTrimBoxOffset [ 
    0.00000 
    0.00000 
    0.00000 
    0.00000 
    ] 
    /PDFXOutputIntentProfile (Adobe RGB \0501998\051) 
    /PDFXOutputConditionIdentifier() 
    /PDFXOutputCondition() 
    /PDFXRegistryName() 
    /PDFXTrapped /False 

    /CreateJDFFile false 
>> setdistillerparams 
<< 
    /HWResolution [600 600] 
    /PageSize [697.080 1128.960] 
>> setpagedevice 

답변

0

포스트 스크립트, 단지 1 개만 12 BPC, 2, 4, 8을 지원하지 않는 1, 2, 4, 8, 12

PDF 처리 및 16.

따라서 중간 형식으로 PostScript를 사용하는 경우 12 개가 넘는 BPC가있는 PDF 파일을 가져올 수있는 방법이 없습니다. PDF 파일 의 16 BPC를 말한다하더라도 실제 데이터가 12 (-> 12 BPC 포스트 스크립트 - 16BPC 원본> 16 BPC의 PDF)로 제한됩니다 더 것과 이제

, 당신은 당신이 PDF를 작성하는 말/A 파일 및 PDF/A-1. PDF/A-1 사양을 읽으면 PDF 1.4로 제한되며 PDF Reference Manual을 확인하면 PDF 1.5로 소개되는 BPC 이미지가 16 개라는 것을 알 수 있습니다.

pdfwrite가 12 BPC 이미지를 16 BPC 이미지 (패딩 포함)로 변환 할 수 없으므로 PDF/A-1 파일을 만들려는 경우 허용되지 않습니다. 사양에서 허용되지 않기 때문입니다. 따라서 원하는대로 할 수 없으므로 도구를 사용하여 16 개의 BPC 이미지로 합법적 인 PDF/A-1 파일을 만들 수는 없습니다.

다운 샘플링과 관련하여 컬러 이미지 다운 샘플링의 기본값은 'false'입니다. 따라서 활성화하지 않으면 (DownsampleColorImages = true) pdfwrite 장치가 이미지를 다운 샘플링하지 않습니다.

+0

이 정보를 제공해 주셔서 감사합니다. 매우 도움이됩니다. ImageMagick 및 Ghostscript가있는 PostScript를 사용하는 것보다 채널당 하나의 TIFF에서 PDF로 16 비트 변환하는 더 좋은 방법이 있습니까? –

+0

직접 PDF 가능 이미지 응용 프로그램이 필요합니다. 어도비 포토샵이 마음에 떠오르지 만, 필자의 사본이 오히려 노인이기 때문에 확신 할 수 없다 ..... 나는 미안하다. 내가 할 수있는 오픈 소스 도구를 모른다. – KenS

관련 문제