TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

How to set compression type?

Forums › TWAIN Classic › How to set compression type?

  • This topic has 3 replies, 3 voices, and was last updated 10 years, 9 months ago by june5.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • March 18, 2010 at 3:11 pm #22591 Reply
    PlaGoogleUser
    Participant
    • Topics - 3
    • Replies - 2
    • Total Posts - 5

    Hello!

    I use scanner (Canon DR-6050C) and faced next problem:
    scanner scans in 24-bit colour mode first 10-15 pages quickly like it should, but after that, scanner begins to scan much slower and after scanning it sends image data rather long.

    After different experiments in different scanning programs and debugging under Twacker, I have found that main point is in compression of the image.
    If I set driver for jpeg compression through memory transfer mode everything is right. I found it using PixEdit by TechSoft scanning program. Now I need to do it in my program.

    But I don’t understand how to do it. What caps should I set and in what order?
    Looking up for this question in TWAIN Specification I mentioned next main words: ICAP_IMAGEFILEFORMAT, ICAP_COMPRESSION, ICAP_JPEGQUALITY, DAT_JPEGCOMPRESSION, TW_JPEGCOMPRESSION,
    but i still don’t understand how and in what order use it, even after looking in CapOrder scheme.

    Thank you,
    Michael

    March 18, 2010 at 4:50 pm #25213 Reply
    jimwatters
    Participant
    • Topics - 2
    • Replies - 72
    • Total Posts - 74

    Not sure about the Canon scanner directly. but in general I would do it this way.

    Set the caps in this order.
    XFERMECH (file or memory)

    If scanning without UI set PixelType, BitDepth, ( if using file – ImageFileformat ), Compression, (if jpeg – JPEGQuality ).

    If scanning with UI then set the compression of all possible PixelType and BitDepth combinations. Example:
    BW, 1bit – G4
    Gray, 8bit – JPEG
    RGB, 24bit – JPEG

    Make sure you do a get ImageInfo for each transfer to know what compression is being used. Memory transfer with compression is a bit more complicated. Width X Height X BitDepth != memory required. If AutomaticBorderDection is turned on you might not even know Width and Height until the transfer is complete.

    Jim Watters

    March 19, 2010 at 9:46 am #25214 Reply
    PlaGoogleUser
    Participant
    • Topics - 3
    • Replies - 2
    • Total Posts - 5

    Thank you for answer.

    I tried to do things the way you’ve written (in comment there are parameters that I set in each function). But I get some strange picture – all black with color noise in the top. And the image is still big

    SetPixelType( TWPT_RGB );
    // cap ICAP_PIXELTYPE, cap type TWTY_UINT16, CallDSMEntry with params: DG_CONTROL, DAT_CAPABILITY, MSG_SET
    SetBitDepth(24);
    // cap ICAP_BITDEPTH, cap type TWTY_UINT16, CallDSMEntry with params: DG_CONTROL, DAT_CAPABILITY, MSG_SET
    SetCompressionType( TWCP_JPEG );
    // cap ICAP_COMPRESSION, cap type TWTY_UINT16, CallDSMEntry with params: DG_CONTROL, DAT_CAPABILITY, MSG_SET
    SetJpegQuality(TWJQ_LOW);
    // cap ICAP_JPEGQUALITY, cap type TWTY_INT16, CallDSMEntry with params: DG_CONTROL, DAT_CAPABILITY, MSG_SET

    Using Twacker, I found that scanner doesn’t support ICAP_COMPRESSION (I found how to find it by that instruction http://support.leadtools.com/CS/forums/3781/ShowPost.aspx , isn’t it wrong?).
    If that true, then there should be another way (another order or another caps), because another program still works with this scanner (PixEdit)

    Thank you,
    Michael

    April 14, 2010 at 11:12 am #25215 Reply
    june5
    Participant
    • Topics - 0
    • Replies - 17
    • Total Posts - 17

    did you set ICAP_XFERMECH?

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: How to set compression type?
Your information:




Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Failed to create TWAIN progress! Error code is 1260.
  • To get the list of scanners from javascript client side (browser)
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.