Chapter30-ColorPromotionFunctions
Variable
Description
blue_handle
Standardfor8-bitgray-scaleimagewhichrepresentsthe
blueplane(cyan).
green_handle
Standardfor8-bitgray-scaleimagewhichrepresentsthe
greenplane(magenta).
red_handle
Standardfor8-bitgray-scaleimagewhichrepresentsthe
redplane(yellow).
k_handle
Standardfor8-bitgray-scaleimagewhichrepresentsthe
blackplane(black).Ifnegative,createsa24-bitRGB
image.
planes_num
Numberofplanesforresultingimage.
Returns
Returnsthestatusofthecolorcombineoperation.AnyvaluelessthanzeroisaSnowbound
errorcode.SeeAppendix
H,
Snowbound
Error
Codes
foralistoferrorcodes.
CIMG_color_separate()
ThisfunctiongetsanindividualplaneofcolordataandreturnsanewRasterMaster.NET
handle.Thenewcolorplaneisan8-bitgrayscaleimage.
Note:
Thequalityoftheconversiontoblackandwhiteorgrayscalecanbeenhancedby
specifyingthealiasandaliasquality.
Syntax
int SNBDAPI CIMG_color_separate(Snowbnd *dest, int plane);
Remark
Table30.2:CIMG_color_separateFunctionVariables
Variable
Description
plane
Theplanecanbeoneofthefollowing:
For32bitcmykplanesare:
0=cyan
1=magenta
2=yellow
3=black
For24-bitrgbplanesare:
0=blue
1=green
2=red
231
Pdf text remover - delete, remove text from PDF file in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Allow C# developers to use mature APIs to delete and remove text content from PDF document
delete text pdf files; pull text out of pdf
Pdf text remover - VB.NET PDF delete text library: delete, remove text from PDF file in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
VB.NET Programming Guide to Delete Text from PDF File
delete text from pdf online; how to delete text in pdf acrobat
Chapter30-ColorPromotionFunctions
Returns
Returnsthestatusofthecolorseparateoperation.AnyvaluelessthanzeroisaSnowbound
errorcode.SeeAppendix
H,
Snowbound
Error
Codes
foralistoferrorcodes.
CIMGLOW_get_tiff_tag()
CIMGLOW_get_tiff_tag()
ThisfunctionreadsaTIFFtagfromthefilespecifiedbybm_name.Thetagmaybeeithera
stringreturnedinbufforalong,int,orcharreturnedinvalue.
Ifthereturnvalueis1,thevaluereturnedisastring.Areturnvalueof0indicatesanon-string
value.
YoucanusetheTIFFtagtogetthecolorspacetypebyspecifyingtag#262.
Syntax
int SNBDAPI CIMGLOW_get_tiff_tag(int tag, int max_bytes, int *ptr_
value, String *strFileName, String *strBuff);
Remark
Table30.3:CIMGLOW_get_tiff_tagFunctionVariables
Variable
Description
tag
TIFFtagnumbertoreturn
max_bytes
Maximumbytestoreadforstringtags
ptr_value
Pointertotagvaluereturned
strFileName
Filenametoreadtagsfrom
strBuff
Stringbufferforreturningstringtags
Returns
Returnsastringoranon-stringvalue.AnyvaluelessthanzeroisaSnowbounderrorcode.See
Appendix
H,
Snowbound
Error
Codes
foralistoferrorcodes.
Example30.1CIMGLOW_get_tiff_tag
Valueiswhatisreturned.Forthistagyouwillnotneedthebytearray.
int tag_no = 262;
int max_bytes = 0;
int[] value = new int[1];
byte[] data = null;
myFrame.Simage.CIMGLOW_get_tiff_tag(tag_no, max_bytes, value,
232
C# PDF Password Library: add, remove, edit PDF file password in C#
An advanced PDF password remover component can help users unlock PDF file without password. Able to change password on adobe PDF document in C#.NET.
remove text from pdf; how to delete text in a pdf acrobat
Chapter30-ColorPromotionFunctions
st,
data, page);
/* PHOTOMETRIC INTERPRETATION */
#define TIFF_PHOTO_WHITE_IS0 0
#define TIFF_PHOTO_WHITE_IS1 1
#define TIFF_PHOTO_RGB 2
#define TIFF_PHOTO_PALETTE 3
#define TIFF_PHOTO_TRANSP 4
#define TIFF_PHOTO_CMYK 5
#define TIFF_PHOTO_YCC 6
#define TIFF_PHOTO_CIELAB 8
233
Chapter31-ColorReductionFunctions
Chapter 31 - Color Reduction Functions
ThischapterdescribestheRasterMaster.NETcolorreductionfunctions.Thequalityofthe
conversionisdeterminedbytheinputandoutputdotsperinchresolutionandtheoutput
compressiontype.Usecolorreductionfunctionstocreatealowerimagequalitythatissmaller
insizeandisspeediertoprocess.Ifyougofromahighertoalowerresolutionoralossy
compressiontype,thenthequalityoftheimagewilldegrade.Thischapterliststhefunctions
thatsaveimageswithmorecolor(largestoutputdepth)tolesscolor(smallersize).
CIMG_color_gray()
Thisfunctionpermanentlyconvertsa4,8,or24-bitimagetoan8-bitgrayscaleimage.
Note:
Thequalityoftheconversiontoblackandwhiteorgrayscalecanbeenhancedby
specifyingthealiasandaliasquality.
WehighlyrecommendtheJPEGcompressionformatasthebestcompression
availableinourlibraryforphototypeimages.
Syntax
int SNBDAPI CIMG_color_gray(void);
Returns
Returnsthestatusofthegrayscaleimageoperation.AnyvaluelessthanzeroisaSnowbound
errorcode.SeeAppendix
H,
Snowbound
Error
Codes
foralistoferrorcodes.
CIMG_resize_to_gray()
Thisfunctionresizesdowna1-bitimagetoan8-bitgrayscaleimageusingthescaletogray
anti-aliasingalgorithm.Thisconvertsa1-bitimagetoan8-bitsuitableimageforsavingasa
JPEGfileformat.Thisfunctionisexcellentforcreatingsmallthumbnailsforlargedocumentsor
1-bitimages.
Note:
Thequalityoftheconversiontoblackandwhiteorgrayscalecanbeenhancedby
specifyingthealiasandaliasquality.
WehighlyrecommendtheJPEGcompressionformatasthebestcompression
availableinourlibraryforphototypeimages.
234
Chapter31-ColorReductionFunctions
Syntax
int SNBDAPI CIMG_resize_to_gray(int width, int height);
Remark
Table31.1:CIMG_resize_to_grayFunctionVariables
Variable
Description
width
Destinationwidthofimagetoresize
height
Destinationheightofimagetoresize
Returns
Returnsthestatusoftheresizetograyoperation.Avalueof0indicatessuccess.Returnsa
PIXEL_DEPTH_UNSUPPORTEDerrormessageiftheimagehasabitdepthofmorethanone
iftheimageisnotblackandwhite.MayreturnanOUT_OF_MEMORYerrormessage.Returns
anOUT_OF_MEMORYerrorifthereisnotenoughmemorytocompletetheoperation.Any
valuelessthanzeroisaSnowbounderrorcode.SeeAppendix
H,
Snowbound
Error
Codes
for
alistoferrorcodes.
CIMG_popularity_color()
Thisfunctionpermanentlyconvertsa24-bitimagetoan8-bitperpixelimageusingthe
popularityalgorithm.Thepopularityalgorithmchooses256ofthemostpopulouscolorsfromthe
image.
Note:
Thequalityoftheconversiontoblackandwhiteorgrayscalecanbeenhancedby
specifyingthealiasandaliasquality.
WehighlyrecommendtheJPEGcompressionformatasthebestcompression
availableinourlibraryforphototypeimages.
Syntax
int SNBDAPI CIMG_popularity_color(void);
Returns
Returnsthestandardlibraryimagehandle.AnyvaluelessthanzeroisaSnowbounderrorcode.
SeeAppendix
H,
Snowbound
Error
Codes
foralistoferrorcodes.
235
Chapter31-ColorReductionFunctions
CIMG_mediancut_color()
Thisfunctionpermanentlyconvertsa24-bitimagetoan8-bitperpixelimageusinga
combinationofthepopularityalgorithmanderrordiffusion.
Note:
Thequalityoftheconversiontoblackandwhiteorgrayscalecanbeenhancedby
specifyingthealiasandaliasquality.
WehighlyrecommendtheJPEGcompressionformatasthebestcompression
availableinourlibraryforphototypeimages.
Syntax
int SNBDAPI CIMG_mediancut_color(void);
Returns
Returnsthestandardlibraryimagehandle.AnyvaluelessthanzeroisaSnowbounderrorcode.
SeeAppendix
H,
Snowbound
Error
Codes
foralistoferrorcodes.
CIMG_octree_color()
Thisfunctionconverts4,8,or24-bitimagesinto4or8-bitasspecified.Itusesacomplex
octreefunctiontoreducetothebestpaletteandnumberofcolorschosen,orreducestheimage
tothepalettepassedintoinput_prgbifthepointerisnotNULL.Thisisbyfarthebestcolor
reductionalgorithminthelibrary.
Note:
Thequalityoftheconversiontoblackandwhiteorgrayscalecanbeenhancedby
specifyingthealiasandaliasquality.
WehighlyrecommendtheJPEGcompressionformatasthebestcompression
availableinourlibraryforphototypeimages.
Syntax
int SNBDAPI CIMG_octree_color(int bits_per_pixel, IMG_RGBQUAD
*input_prgb, int entries);
Remark
Table31.2:CIMG_octree_colorFunctionVariables
Variable
Description
bits_per_pixel
Pixeldepthtoconvertto:4or8
236
Chapter31-ColorReductionFunctions
Variable
Description
input_prgb
PointertoarrayofRGBQUADstructures
entries
Numberofcolorstoreduce
1-16for4-bitimages
1-256for8-bitimages
Returns
Returnsthestandardlibraryimagehandle.AnyvaluelessthanzeroisaSnowbounderrorcode.
SeeAppendix
H,
Snowbound
Error
Codes
foralistoferrorcodes.
Example31.1CIMG_octree_color
C#:status = simage.CIMG_octree_color(4, null, 16)
CIMG_bayer_color()
Thisfunctionpermanentlyconvertsan8or24-bitimagetoa4-bitperpixelimageusinga16by
16Bayermatrixdither.
Note:
Thequalityoftheconversiontoblackandwhiteorgrayscalecanbeenhancedby
specifyingthealiasandaliasquality.
WehighlyrecommendtheJPEGcompressionformatasthebestcompression
availableinourlibraryforphototypeimages.
Syntax
int SNBDAPI CIMG_bayer_color(void);
Returns
Returnsthestandardlibraryimagehandle.AnyvaluelessthanzeroisaSnowbounderrorcode.
SeeAppendix
H,
Snowbound
Error
Codes
foralistoferrorcodes.
CIMG_bayer_mono()
Thisfunctionpermanentlyconvertsa4,8,or24-bitimagetoa1-bitperpixelimageusinga
Bayerfixedmatrixditheringtechnique.
Note:
Thequalityoftheconversiontoblackandwhiteorgrayscalecanbeenhancedby
237
Chapter31-ColorReductionFunctions
specifyingthealiasandaliasquality.
WehighlyrecommendtheJPEGcompressionformatasthebestcompression
availableinourlibraryforphototypeimages.
Syntax
int SNBDAPI CIMG_bayer_mono(void);
Returns
Returnsthestandardlibraryimagehandle.AnyvaluelessthanzeroisaSnowbounderrorcode.
SeeAppendix
H,
Snowbound
Error
Codes
foralistoferrorcodes.
CIMG_diffusion_mono()
Thisfunctionpermanentlyconvertsa4,8,or24-bitimagetoa1-bitperpixelusingtheStucky
errordiffusiontechnique.
Notes:
Thequalityoftheconversiontoblackandwhiteorgrayscalecanbeenhancedby
specifyingthealiasandaliasquality.
WehighlyrecommendtheJPEGcompressionformatasthebestcompression
availableinourlibraryforphototypeimages.
CIMG_
decompress_
bitmap
mustbecalledbeforeCIMG_diffusion_mono.Itis
designedforuseonrasterizedpages.Itcannotbeusedonpageswithvectorcontent
createdbyCIMGLOW_
extract_
text
.
Syntax
int SNBDAPI CIMG_diffusion_mono(void);
Returns
Returnsthestandardlibraryimagehandle.AnyvaluelessthanzeroisaSnowbounderrorcode.
SeeAppendix
H,
Snowbound
Error
Codes
foralistoferrorcodes.
CIMG_thresh_mono()
Thisfunctionpermanentlyconvertsa4,8,or24-bitimagetoa1-bitperpixelimageusinga
thresholdpassedasthesecondargument.
Note:
Thequalityoftheconversiontoblackandwhiteorgrayscalecanbeenhancedby
238
Chapter31-ColorReductionFunctions
specifyingthealiasandaliasquality.
WehighlyrecommendtheJPEGcompressionformatasthebestcompression
availableinourlibraryforphototypeimages.
Syntax
int SNBDAPI CIMG_thresh_mono(int threshhold);
Remark
Table31.3:CIMG_thresh_monoFunctionVariable
Variable
Description
threshhold
Thresholdvaluetouse.Therangeisfrom1-255.
Returns
Returnsthestandardlibraryimagehandle.AnyvaluelessthanzeroisaSnowbounderrorcode.
SeeAppendix
H,
Snowbound
Error
Codes
foralistoferrorcodes.
CIMG_halftone_mono()
Thisfunctionpermanentlyconvertsa4,8,or24-bitimagetoa1-bitperpixelimageusingafixed
halftonematrixditheringtechnique.
Notes:
Thequalityoftheconversiontoblackandwhiteorgrayscalecanbeenhancedby
specifyingthealiasandaliasquality.
WehighlyrecommendtheJPEGcompressionformatasthebestcompression
availableinourlibraryforphototypeimages.
Syntax
int SNBDAPI CIMG_halftone_mono(void);
Returns
Returnsthestandardlibraryimagehandle.AnyvaluelessthanzeroisaSnowbounderrorcode.
SeeAppendix
H,
Snowbound
Error
Codes
foralistoferrorcodes.
CIMGLOW_detect_color()
239
Chapter31-ColorReductionFunctions
CIMGLOW_detect_color()
Thisfunctionchecksallpixelstodetermineiftheimageiscolororgrayscale.Indocuments
withamixofblackandwhiteandcolorpages,youcanimproveperformanceandreducethe
outputdocumentsizebyensuringtheblackandwhitepagesaresavedas1-bitperpixel
(monochrome)ratherthan24-bitsperpixel(color).Usethisfunctiontodetectthepresenceof
grayscaleorcolorpixelsonthecurrentpage.Ifthebitdepthreturnedbythismethodisless
thanthebit-depthreturnedbyCIMG_
bitmap_
info
()
inbiBitCount,thenyoushouldconsider
convertingtoalowerbitperpixelformat.SnowboundSoftwarerecommendsconvertingto
CCITT_TIFF_G4formatforblackandwhitetextimages.
Notes:
Thequalityoftheconversiontoblackandwhiteorgrayscalecanbeenhancedby
specifyingthealiasandaliasquality.
WehighlyrecommendtheJPEGcompressionformatasthebestcompression
availableinourlibraryforphototypeimages.
Syntax
int CIMGLOW_detect_color(int);
Returns
Returnsthebitsperpixeloftheimage.Ifthisfunctionreturns1,thenthisimagecontainsonly
blackandwhitepixels.Ifthisfunctionreturns8,thenthisimagecontainsgrayscaledatasuch
asblackandwhitephotoorshadedgraphics.Ifthisfunctionreturns24,thenthisimage
containsatleastsomecontentthatusesfullcolor.Avalueof0indicatessuccess.Anyvalue
lessthanzeroisaSnowbounderrorcode.SeeAppendix
H,
Snowbound
Error
Codes
foralist
oferrorcodes.
Example31.2CIMGLOW_get_pages
page_count = CIMGLOW_get_pages("file.pdf");
for (x = 0; x < page_count; x++)
{
status = CIMG_decompress_bitmap_page("file.pdf",x);
bitspix = CIMGLOW_detect_color();
if (bitspix == 24)
status = CIMG_save_bitmap
(imghandle,"c:\\temp\\mixed.tif",TIFF_JPEG);
else
{
if (bitspix == 8)
CIMG_thresh_mono(128);
status = CIMG_save_bitmap("c:\\temp\\mixed.tif",TIFF_G4_FAX);
240
Documents you may be interested
Documents you may be interested