Search found 25 matches

by jmspaggi
2020-03-02T06:05:18-07:00
Forum: Users
Topic: Auto gravity to minimize background?
Replies: 14
Views: 1759

Re: Auto gravity to minimize background?

Looking at what you provided before, I think this might do exactly what I want: convert step2.png -statistic mean 150x150 +write s.png -define identify:locate=maximum info: Where step2.png is the s.png picture from your script... It's like giving a 2nd pass on the same logic and maximizing the surfa...
by jmspaggi
2020-03-02T04:23:47-07:00
Forum: Users
Topic: Auto gravity to minimize background?
Replies: 14
Views: 1759

Re: Auto gravity to minimize background?

Hi, providing a feedback here. I tried many things to remove this ugly background. I realized quickly that scanner with the cover closed was not a solution. Indeed, even if not all brands are giving the same result, there is still a small shadow arround the piece, that is not 100% white and very har...
by jmspaggi
2020-02-26T13:22:21-07:00
Forum: Users
Topic: Auto gravity to minimize background?
Replies: 14
Views: 1759

Re: Auto gravity to minimize background?

I think I need to re-scan the pictures. The last scanner I used is doing an ugly shadow that causes many issues to detect and remove the white and replace it with transparent. I will re-scan them this week-end and give all of this another try. I will come back to comment on this. This background rem...
by jmspaggi
2020-02-26T12:35:11-07:00
Forum: Users
Topic: Auto gravity to minimize background?
Replies: 14
Views: 1759

Re: Auto gravity to minimize background?

Oh! That super nice and indeed works pretty well! I applied it on 1000 pictures and I found one interesting situation that I'm wondering if there is an optimization for. Here is the source picture: https://i.postimg.cc/ydfMqWy0/clean-2020-02-22-104537-jpg-part-03.png Here is what the script will ext...
by jmspaggi
2020-02-26T06:10:31-07:00
Forum: Users
Topic: Auto gravity to minimize background?
Replies: 14
Views: 1759

Re: Auto gravity to minimize background?

Ok. I think I have been able to apply some nice cleanup to get more background. Here is a cleanup piece: https://i.postimg.cc/XYR8GyfN/ouput.png Here is the new result of your command in a cleaned-up piece: https://i.postimg.cc/W4pMJ6Dv/out.png Even manually I can hardly select a better 100x100 extr...
by jmspaggi
2020-02-26T05:07:02-07:00
Forum: Users
Topic: Auto gravity to minimize background?
Replies: 14
Views: 1759

Re: Auto gravity to minimize background?

Overall result is pretty good, but for some pieces I have more white around and less background and he doesn't target correctly. https://i.postimg.cc/L6nvGhJB/2020-02-22-094921-jpg-part-43.png https://i.postimg.cc/J4f3gxVM/crop-2020-02-22-094921-jpg-part-43.png One solution might be to remove all wh...
by jmspaggi
2020-02-26T04:47:46-07:00
Forum: Users
Topic: Auto gravity to minimize background?
Replies: 14
Views: 1759

Re: Auto gravity to minimize background?

Any idea why I get the output at Gray instead of the 3 channels like you?

Channel maximum locations:
Gray: 6627 (0.101122) 127,238
by jmspaggi
2020-02-26T04:46:03-07:00
Forum: Users
Topic: Auto gravity to minimize background?
Replies: 14
Views: 1759

Re: Auto gravity to minimize background?

Wow! That looks that a very good solution so far! I will apply that on all the pictures and see, but at least on that one the result is very good! Thanks!
by jmspaggi
2020-02-26T03:58:58-07:00
Forum: Users
Topic: Auto gravity to minimize background?
Replies: 14
Views: 1759

Re: Auto gravity to minimize background?

Thanks. That was my feeling too. I'm not even sure scripting is the best way. Because I will have to generate 160k extract for each picture. That's a lot of files. I might just build a small tool to do just that, to avoid going back to disk.
by jmspaggi
2020-02-25T18:10:59-07:00
Forum: Users
Topic: Auto gravity to minimize background?
Replies: 14
Views: 1759

Auto gravity to minimize background?

Hi, Is there an option to extent a picture and set the gravity to something like "auto" to minimize the background? Consider this picture: https://i.postimg.cc/PxBGGW5Z/2020-02-22-102908-jpg-part-44.png if I run convert file.jpg -background transparent -gravity center -extent 100x100 output.jpg I ge...
by jmspaggi
2020-02-11T18:11:29-07:00
Forum: Users
Topic: Extracting sprites/images from a bigger image
Replies: 17
Views: 2188

Re: Extracting sprites/images from a bigger image

Wow! Seems that I can stop working on it! Seems to be working very well! I tried to reduce the fuzz parameter, to "eat" less of the white piece, but I can see the line that we talked about before. I will check if there is something on the scanner, or on the way I installed the pieces. I will also tr...
by jmspaggi
2020-02-11T13:24:22-07:00
Forum: Users
Topic: Extracting sprites/images from a bigger image
Replies: 17
Views: 2188

Re: Extracting sprites/images from a bigger image

Ha, that looks pretty nice. I'm totally fine with losing a few pixels on the corners. I'm not going to try to match the forms/sides, but I want to do Image Recognition instead. But I want to focus on the clean piece, not the dust. So just to make sure I get the steps correct. I do a binary operation...
by jmspaggi
2020-02-11T11:40:22-07:00
Forum: Users
Topic: Extracting sprites/images from a bigger image
Replies: 17
Views: 2188

Re: Extracting sprites/images from a bigger image

I thought about that, but issue is pieces can be any color. There are red pieces, black one, blue one, etc. I will definitely clean the glass for the next set of test pictures. I will remove some white dots, but will not make the black become real black :-/ The black is when I scan at night and I ke...
by jmspaggi
2020-02-11T11:20:51-07:00
Forum: Users
Topic: Extracting sprites/images from a bigger image
Replies: 17
Views: 2188

Re: Extracting sprites/images from a bigger image

Here are 2 examples of files. Black background 01 Black background 02 I can also make them with a white background if it's better, but here again, the white is not always 100% white :-/ White background 01 White background 02 The white pattern is a bit more easy to scan, but I had more trouble isola...
by jmspaggi
2020-02-11T07:16:11-07:00
Forum: Users
Topic: Cache resources exhausted
Replies: 5
Views: 1339

Re: Cache resources exhausted

Ha!!!! Updating /etc/ImageMagick-6/policy.xml gives me what I want. Limits in the policy.xml file are maximum. So the 256MiB defined there by default is a maximum. Using the -limit command allows you to reduce this maximum, in case you are running low on memory or other. But you can't increase it. T...