Dividing One large Image to many smaller images

Dear Java developers,
I have 1 Large Image, and I want to divide it
into many smaller images, But I don't see
any Java API to make it...
Anybody can help me ?
Thanks in Advance,

I'd guess using BufferedImage and subimages thereof is faster than filtering it. Although it depends much on the implementation of the original image source, and its caching strategies. But it's pretty certain that when you are creating a BufferedImage which is appropriate for you current color model, you avoid most conversions which may be needed when rendering directly from an image source.
Having said that, the image source and filtering way may even use more memory and cpu than the buffered image way. At least temporary. But the image source is allowed to release almost all memory associated with the image, down to retaining only the original URL.
In simpler words:
- With BufferedImage you can be quite sure how much memory it will need. Add up the space needed for the Raster and auxiliary data and there you are. It won't change much over time. But it's not present in JDK 1.1.
-- Simple, predictable and modern.
- ImageSource is pretty much opaque in how much memory it will use. However, it's interface allows dropping most resources and re-creating them on demand. Of course, you'll know what it does when you're implementing it yourself. Which I tend to do from time to time.
-- Complex (flow control), opaque but present in JDK 1.1.
Your mileage may vary. There would be no challenge in programming if there were no tough decisions to be made ;-)
/kre

Similar Messages

  • Creating and organizing one large document from many small "forms"

    I'm organizing a symposium and attendees submit abstracts.
    I have set up a "form" using Word to distribute to people to fill out and named all the fields, example: "Title," "Firstauthor," "Body." Etc.
    They are going to email me completed forms.
    I was hoping that it'd be easy to make a drag/drop Script so that I can just drag and drop these files to create big document that would organize the abstracts & attendees into a program.
    Word has the "catalog" creation option in the merge-manager. But it uses some sort of tab delimiting scheme for acquiring its data when it's going to be in the form of various fields and the field-names.
    At my disposal, I also have File Maker Pro, but doesn't really seem to be able to do what I want to. I don't want to manually enter information (hundreds of attendees).
    Could I make a script that would:
    tell FileMaker to open a database and create a new entry
    tell word to get from a field "FirstName" and copy to clipboard
    tell filemaker to paste from clipboard to cell "firstname" of the new entry
    ....etc. with the other the fields .... and so on? to create the database in file maker. and then in Word, the merge-manager has a user-friendly interface to merge data from a FileMaker database and use the create a catolog feature. Is this too convoluted?
    Any suggestions on the best route? any ideas? I don't think what I'm trying to do is all that unusual.
    I've never written an applescript, but I have used them and I read about the language. I am generally a quick learner .... I just need to be pointed into the best plan of attack or know what the capabilities are.
    Powerbook G4   Mac OS X (10.4.8)   OfficeX and File Maker Pro
    Powerbook G4   Mac OS X (10.4.8)  

    Hi Ettor,
    Firstly, if the document is password protected, then I don't know if it could be done. Tatro's documents probably aren't. The first step is to unprotect the fill-in form document with ui scripting:
    tell application "Microsoft Word" to activate
    tell application "System Events"
    tell process "Microsoft Word"
    tell menu bar 1
    tell menu "Tools"
    delay 1
    click menu item "Unprotect Document"
    end tell
    end tell
    end tell
    end tell
    The document needs to be unprotected for macros to work. from there you can run a saved macro that sets the Save Preference, Save data only for forms. I named my recorded macro "ChangeFormPref". The macro could probably save the file also, but I wanted a simple macro. To run the macro, I found this on the Internet somewhere:
    do Visual Basic "Application.Run \"ChangeFormPref\""
    At this point, when you save the document, it's saved as text with AppleScript. Here's the entire script with no error checking:
    set dp to (path to desktop as string)
    set fs to (dp & "new.txt")
    tell application "Microsoft Word" to activate
    tell application "System Events"
    tell process "Microsoft Word"
    tell menu bar 1
    tell menu "Tools"
    delay 1
    click menu item "Unprotect Document"
    end tell
    end tell
    end tell
    end tell
    tell application "Microsoft Word"
    activate
    do Visual Basic "Application.Run \"ChangeFormPref\""
    delay 1
    save front document in fs
    end tell
    The delays may not be necessary, except for the one that waits for Word to activate. Here, I just placed the new.txt file on the desktop for testing.
    Next, AppleScript could easily concatenate the files creating data for a database. I would probably use the new.txt file as a temporary file, read that file, concatenate to a main file, clear the temp file, rewrite to it with Word, etc.. It might be faster though to create all the files first with some naming convention.
    I wasn't sure if Tatro was coming back, but am glad someone may use it.
    Note that Tatro is using Word X.
    Edited: I should give a warning that if you unprotect document and protect it again you lose the data. reprotecting seems to clear the form.
    gl,

  • How do I divide a large catalogue into two smaller one on the same computer?

    How can I divide a large catalogue into two smaller ones on the same computer?  Can I just create a new catalogue and move files and folders from the old one to the new one?  I am using PSE 12 in Windows 7.

    A quick update....
    I copied the folder in ~Library/Mail/V2/Mailboxes that contains all of my local mailboxes over to the same location in the new account. When I go into mail, the entire file structure is there, however it does not let me view (or search) any of the messages. The messages can be accessed through the Finder, though.
    I tried to "Rebuild" the local mailboxes, but it didn't seem to do anything. Any advice would be appreciated.
    JEG

  • Few large nodes or many small nodes

    Hi guys,
    In general, what option is better to implement a RAC system; few large nodes or many small nodes?
    Say we have a system with 4 nodes of 4 CPU and a system with 8 nodes of 2 CPU. Will there be a performance difference?
    I understand there won't be a clear cut answer for this. But I'd like to learn from your experiences.
    Regards,

    Hi,
    The worst case in terms of block transfer is 3-way, doesn't matter if you have 100 nodes a single block will be accessed at max in 3 hops. But there are other factors to consider
    example if you're using FC for SAN connectivity I'd assume trying to connect 4 servers could cost more than 2 servers.
    On the load let's say your load is 80 (whatever units) and equally distributed among 4 servers each servers will have 20 (units). If one goes down or shutdown to do a rolling patch then load of that will be distributed among other 3 so these will have 20 + 20/3 = 26.666. Imagine the same scenario if there was only two servers then each will have 40 and if one goes down one server has to carry the entire load. So you have to do some capacity planning interms of cpu to decide if 4 nodes better or 2 nodes better.

  • 1 large lun or many smaller luns

    Hi,
    I'm running Oracle 10g/11g. I'm NOT using ASM (that isn't an option right now). My storage is IBM DS3500 with IBM SVC in front of it.
    My question is, is it better to have 1 large lun or many smaller luns for the database (assuming its the same number of spindles in both cases)?
    Are there any limitations with queue depth..etc. I need to worry about with the 1 large lun?
    Any info would be greatly appreciated.
    Thanks!

    Hi,
    You opened this thread on ASM forum and you are not using ASM Filesystem (???????)....what gets dificult to answer your questions.
    Well...
    First you need to consult the manual/whitepapers/technotes of filesystem that you will use to check what are the recommendations for the database using this filesystem.
    eg. using JFS2 on AIX you can enable CIO...
    Another point:
    Create large luns can be useful and can be not. All depends on the characteristics of your env.
    e.g: I believe is not good placing 2 databases with different characteristcs of access/troughput in same filesystem. One database can cause performance issue on others database if theys share same Lun.
    I particularly dislike Large Luns to an environment that will store several database .... I usually use Large Luns for large databases, and yet without sharing the area with other databases.
    My thoughts {message:id=9676881} although it is valid for ASM.
    I recommend you read it:
    http://docs.oracle.com/cd/E11882_01/server.112/e16638/iodesign.htm#PFGRF015
    Regards,
    Levi Pereira

  • Split one long sequence to many small sequences

    a long sequence can be divided into many small ?
    Se picture:

    It looks like you want to end up with four, smaller sequences.
    Make four copies of your pictured 'master sequence',
    then delete the unwanted sections in each of the four copies.

  • SELECT query performance : One big table Vs many small tables

    Hello,
    We are using BDB 11g with SQLITE support. I have a query about 'select' query performance when we have one huge table vs. multiple small tables.
    Basically in our application, we need to run select query multiple times and today we have one huge table. Do you guys think breaking them into
    multiple small tables will help ?
    For test purposes we tried creating multiple tables but performance of 'select' query was more or less same. Would that be because all tables will map to only one database in backed with key/value pair and when we run lookup (select query) on small table or big table it wont make difference ?
    Thanks.

    Hello,
    There is some information on this topic in the FAQ at:
    http://www.oracle.com/technology/products/berkeley-db/faq/db_faq.html#9-63
    If this does not address your question, please just let me know.
    Thanks,
    Sandra

  • Simultaneous hash joins of the same large table with many small ones?

    Hello
    I've got a typical data warehousing scenario where a HUGE_FACT table is to be joined with numerous very small lookup/dimension tables for data enrichment. Joins with these small lookup tables are mutually independent, which means that the result of any of these joins is not needed to perform another join.
    So this is a typical scenario for a hash join: the lookup table is converted into a hashed map in RAM memory, fits there without drama cause it's small and a single pass over the HUGE_FACT suffices to get the results.
    Problem is, so far as I can see it in the query plan, these hash joins are not executed simultaneously but one after another, which renders Oracle to do the full scan of the HUGE_FACT (or any intermediary enriched form of it) as many times as there are joins.
    Questions:
    - is my interpretation correct that the mentioned joins are sequential, not simultaneous?
    - if this is the case, is there any possibility to force Oracle to perform these joins simultaneously (building more than one hashed map in memory and doing the single pass over the HUGE_FACT while looking up in all of these hashed maps for matches)? If so, how to do it?
    Please note that the parallel execution of a single join at a time is not the matter of the question.
    Database version is 10.2.
    Thank you very much in advance for any response.

    user13176880 wrote:
    Questions:
    - is my interpretation correct that the mentioned joins are sequential, not simultaneous?Correct. But why do you think this is an issue? Because of this:
    which renders Oracle to do the full scan of the HUGE_FACT (or any intermediary enriched form of it) as many times as there are joins.That is (should not be) true. Oracle does one pass of the big table, and then sequentually joins to each of the hashmaps (of each of the smaller tables).
    If you show us the execution plan, we can be sure of this.
    - if this is the case, is there any possibility to force Oracle to perform these joins simultaneously (building more than one hashed map in memory and doing the single pass over the HUGE_FACT while looking up in all of these hashed maps for matches)? If so, how to do it?Yes there is. But again you should not need to resort to such a solution. What you can do is use subquery factoring (WITH clause) in conjunction with the MATERIALIZE hint to first construct the cartesian join of all of the smaller (dimension) tables. And then join the big table to that.

  • Using JAI to discover if a larger image contains a smaller image

    Lets say I have an image that contains an icon somewhere in white space that is 500x500 pixels.
    I also have an image of the icon itself, say its 50x50px.
    What is the best way to make a function called:
    public boolean containsImages( Image haystack, Image needle)
    that returns true is the image needle is containd in the haystack....
    The application is I want to take a printscreen using a Robot and discovering if an icon is turned on or not... I need to do it via print screen because the window containing the icon is a remote-desktop window
    Thanks anyone =)
    Omid S.

    Lets say I have an image that contains an icon somewhere in white space that is 500x500 pixels.
    I also have an image of the icon itself, say its 50x50px.
    What is the best way to make a function called:
    public boolean containsImages( Image haystack, Image needle)
    that returns true is the image needle is containd in the haystack....
    The application is I want to take a printscreen using a Robot and discovering if an icon is turned on or not... I need to do it via print screen because the window containing the icon is a remote-desktop window
    Thanks anyone =)
    Omid S.

  • One large message or multipels small ones?

    Hi:
    I'm working in an application using weblogic 8.1.
    We receive in a JMS queue a large message containing thouthands of transactions to be processed.
    What should be more eficient? processing the whole transactions in the message (with one MDB) or split the large message in smaller ones and process "in paralel" with multiples MDB and somehow join all the results to return as the whole process result (hiding the client from this split/join) ?
    Keeping all the execution in the same transaction would be desireable, but we could create multiple independant transactions to process each small message, but the result must be consistent in what transactions were processed successfully and what weren't.
    If splitting is the option: Is there any tip on doing this?
    thanks in advance.
    Guillermo.

    Hi Guillermo,
    I would recommend reading the book
    Enterprise Integration Patterns by Gregor Hohpe
    http://www.eaipatterns.com/
    This book describes the split and join process very good.
    If the messaging overhead is little compared to total job time it would be a good idea to split
    (if the tasks also run well in paralel, get quick out of the DB if you run against one DB).
    Are you doing transactions against a DB?
    Are you using several computers to distribute the work or a multiprocessor computer?
    You can also test performance and try to split to 1, 5 or 10 transactions/msg.
    When you split, keep track of total number of transations per job (= N),
    and when number of successful transactions + number of failed transactions = N you are finished.
    You could send the result per msg to a success or failure channel.
    Regards,
    Magnus Strand

  • One large library or several smaller libraries?

    I have a macbook air 2011, 120gb, 1.7ghz intel core i5, 4gb memory.
    I combined two aperture libraries that were about 250gb each and ran fine on my external hard drive.  Now that i've migrated to  Photos, Photos runs super sluggish.  I realize faces is still processing as well as thumbnails, etc but it's been days.
    I run a regular 2.0 usb hard drive and i'm wondering if having the 500gb library is a waste since I don't have thunderbolt.  Also, do i just need faster processing and more memory or does that not matter?
    I would love to just have one library but this is all i have for peripherals at the moment

    IF there is an issue, I don't think it would be because of the library size in terms on storage, but instead in terms of the number of things in the library.
    In other words, if your 750Gb library is because you have tens of thousands of small MP3 files, many playlists, especially smart playlists, etc. you may experience performance issues whenever iTunes needs to update anything.
    On the other hand, if your library is 750GB because you import everything as WAV files (or AIFF or Apple Lossless) then it is because you have big files, but not that many of them (1000 uncompressed albums for roughly 10k-15k tracks) and so you shouldn't see a problem with iTunes because it doesn't have as many things to manage.
    Cheers,
    Patrick

  • How to split a large PDF into many smaller PDFs

    In my wanderings, I couldn't find an answer to this question. Thus my post.
    I have a large, 20 page, pdf. I'd like to split that pdf into 10 two page pdfs. How can I do it?
    The 20 pager is a pdf of a number of account statements. The account statements varying in length from 1 to 3 pages. I'd like to split the pdf so I end up with one pdf per account.
    In advance, thank you for your help

    Hi.
    It's simple: open the PDF, go to File, Print, and in the print dialog select Copies & Pages, enter the range you want, click PDF/Save as PDF.
    Good Luck.
    MacMini G4 1.25GHz 1GB   Mac OS X (10.4.9)  

  • Creating one large pdf from 2 smaller pdfs

    Is there a way to do this in Acrobat 7? I have several single pages which are 6" x 10.5" which I want to create reader spreads with.
    thanks

    The short answer is "No." To do this, you should place the two pages into InDesign, and make a new PDF.
    Or you should acquire a PDF imposition plug-in. To find them, you could do a Google search for "PDF imposition".

  • Two small drive or one large drive

    Hi All, this is closely related to the previous question but there were some subtleties I wanted to bring up. i was wondering if i could get your take on whether I should get one large drive or two smaller ones. I'm looking to use the external drive as my startup volume. is it true that using a larger drive can actually lower the performance of your computer? I the G3 500 only has one firewire 400 port but it's about time for me to upgrade anyway. the iomega triple interface (black) drives get pretty good reviews so I'm either gonna go for two 250 GB or one 400GB. for safety reasons, i thought that two drives would be better but it turns out that the 400GB has a 8mb cache while the 250GB has only 2mb of cache. is this going to make much difference to the performance of my computer?
    Cheers.

    Hi, K.L.T.
    • A FireWire drive as a startup disk on a FW 400 port is going to perform slower than your internal hard drive, regardless of the size of the drive. However, you may not notice that much of a difference, other than a slower boot. Cache size will make a bit of difference, but so will rotational speed. You want fast drives (7200 RPM+) and lots of cache (8 MB is nice) for best performance.
    • One can find 250 GB FireWire drives with 8 MB cache. I buy all my FireWire drives from Other World Computing (OWC). I've been very happy with the drives and their service. I'd recommend them over Iomega any day of the week.
    • One drive vs. two: One drive = all your eggs in one basket. Two FireWire drives gives you the option of having redundant backups on each. Something to consider.
    • See also my post here.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • How can I view a series of images in the same image frame?

    I'm an intermediate level user and recently saw a feature on a web site that I'd like to incorporate in my own designs. I'm looking for an instructional link to explain this process. On a published web site there is an image. To the right side and left side of this main image are two small images: a "forward triangle" and a "reverse triangle". When you click on the forward triangle the main image changes to image #2, then again to image #3. Clicking on the left-sided "reverse triangle" takes the user back to image #2, then image #1. All main images are located inside the same frame, it's just that you can click back and forth through a series of half a dozen images. It seems easy, but I just can't find the right instructions. Can anyone suggest a link or two? Thanks!

    From the code
    <script src="javascript/jquery-1.2.1.pack.js" type="text/javascript"></script>
    <script src="javascript/jquery-easing.1.2.pack.js" type="text/javascript"></script>
    <script src="javascript/jquery-easing-compatibility.1.2.pack.js" type="text/javascript"></script>
    <script src="javascript/coda-slider.1.1.1.js" type="text/javascript"></script>
    It's using this script
    http://www.ndoherty.biz/tag/coda-slider/
    See also
    http://jqueryfordesigners.com/coda-slider-effect/

Maybe you are looking for