Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Hello,
I am currently developing a utility for the PC game Diablo 3. I would like to use IM to extract what are called "item cards" from screenshots taken of the game. Here is an example of a typical screenshot of a user's inventory, with an item card:
The item card is directly next to the mouse cursor in the screenshot. I've viewed the background removal/masking page and I'm a little confused about how best to go about this. There was a similar utility created using very small corner samples from item cards that is no longer functioning, so I think that may be one of the best ways to go about this.
Important details:
Item cards vary in height, but never in width
Cards will always be within a small radius of the mouse cursor, which never varies in size, shape, or color
Screenshots will not be .jpg, I simply converted the above example for ease of uploading
Because I am creating this program for a potentially large userbase, the more versatile the trimming method, the better. Slight differences in resolution or gamma settings might produce problems.
Some of Fred's scripts would obviously be very useful here but unfortunately I'm limited to a Windows environment (I am a longtime Linux user but sadly Diablo 3 is only Windows and OS X native). The script I wind up making to do this will probably be in python or another language. Just from the hour or so I've spent browsing the forums I've seen how dedicated and helpful the IM devs are so thank you in advance for any help you can offer. I have a ton of work to do on this program and IM is shaping up to be a big part of it.
I would break it up into smaller problems for seperate topics.
Starting with 'locating the cursor image' does it appear in the actualy image, or is it provides as a separate coodinate location.
Could the cursor be obscuring part of the desired image?
Next step is search near cursor for the identifying marks of what you want.
Actually you may be better just looking for those marks directly rather than the cursor. (see above links)
Could their be multiple matches? What if you don't get a match?
The cursor is probably not useful at all. Whatever screenshot utility will most likely have an option to disable it anyway. The exact pixels of the corners of an item card's border should be enough to determine the crop, right? I made two BMP samples of the corners (top left and bottom right) that are 7px by 7px and that should be unique enough to identify the rectangle I want to crop. How can I tell imagemagick to crop using those two samples?
Edit: Will converting the samples and the screenshot to text have something to do with it?
I get it now, I really should have read more thoroughly. Thanks for you help Anthony! Should I post in here again if I run into further issues or make a new thread?