It is currently Sun Aug 16, 2026 4:31 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: experimenting Pack Sprites. Is there a BUG?
PostPosted: Sat Oct 10, 2015 3:41 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
maybe I'm again missing something, but let me tell you, David, some doubts on -for me- unexpected results from your Pack Sprites (very very nice!) filter.
Let's take a base image (BG + mask), such as this one:
Attachment:
Fruit-Alphonse-Mucha_BG.jpg
Fruit-Alphonse-Mucha_BG.jpg [ 425.88 KiB | Viewed 4810 times ]

(text is shown as white but it's really transparent)
Let's take a lot (26) of sprites to load as layers on top, like these:
Attachment:
TEST_LETTERS_2.7z [2.1 MiB]
Downloaded 210 times

Now I run Pack Sprite with the following parameters:
pack_sprites 10,10,0,-7,7,1
as you see, I set angle=0 for this first test (-7 as spacing to let letters overlay each other)
I get the following result (nice)
Attachment:
Fruit-Alphonse-Mucha_BG_pack_sprites 10,10,0,-7,7,1.jpg
Fruit-Alphonse-Mucha_BG_pack_sprites 10,10,0,-7,7,1.jpg [ 547.38 KiB | Viewed 4810 times ]


now, let me continue with the next post...

_________________
"Where am I ?"


Last edited by dinasset on Sat Oct 10, 2015 6:02 am, edited 1 time in total.

Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: experimenting Pack Sprites
PostPosted: Sat Oct 10, 2015 3:48 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
with this second test, I want to see how spaces can be filled using "any angle"
thus I run the filter with the following parameters
pack_sprites 10,10,3,-7,7,1
as you see, only the "angle" parameter has changed from 0 (do not change sprites orientation) to 3 (manipulate sprite orientation using any angle)
here the surprise, this is the outcome:
Attachment:
Fruit-Alphonse-Mucha_BG_pack_sprites 10,10,3,-7,7,1.jpg
Fruit-Alphonse-Mucha_BG_pack_sprites 10,10,3,-7,7,1.jpg [ 413.59 KiB | Viewed 4809 times ]


is there a bug?
thanks

_________________
"Where am I ?"


Top
 Post subject: Re: experimenting Pack Sprites
PostPosted: Sat Oct 10, 2015 4:08 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
to complete the info for David:
also using option 1 or 2 (180° or 90° angles) the text area in the outcome is either totally empty or showing 2 or 3 sprites

_________________
"Where am I ?"


Top
 Post subject: Re: experimenting Pack Sprites. Is there a BUG?
PostPosted: Sat Oct 10, 2015 7:34 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12831
Mask has to be 100% rigid (0 or 1) for starters. Also, if it's a flat mask (black and white) it cannot have any transparencies (alpha channel). :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: experimenting Pack Sprites. Is there a BUG?
PostPosted: Sat Oct 10, 2015 8:05 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
I don't understand you Lyle.
What has to do what you say with the different behaviour of the filter selecting "no angles" or "any angle"?
The BG / mask is always the same.

_________________
"Where am I ?"


Top
 Post subject: Re: experimenting Pack Sprites. Is there a BUG?
PostPosted: Sat Oct 10, 2015 8:26 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12831
Guess I read too fast dinasset. Haven't played with the no angle option that often. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: experimenting Pack Sprites. Is there a BUG?
PostPosted: Sat Oct 10, 2015 8:36 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12831
Another program you can try is PikPak. It's free and apparently will stay that way since the business model Johnny decided to follow is for selling object packs (and you don't need to use those packs; you can make your own). I did purchase several packs to help support the program, but Johnny's not had an update for a few years now. It's still worth it though and I do occasionally still use it. It allows pretty precise angle control too. :)

viewtopic.php?f=22&t=8042

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: experimenting Pack Sprites. Is there a BUG?
PostPosted: Sat Oct 10, 2015 8:47 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
yes, I remember you mentioned that (and I also tried it, very nice), but my objective -as far as possible- is to stay in the Gimp+G'MIC world.
From time to time I write filters and I access available functions in there.
Currently I'm experimenting that G'MIC filter and noticed that inconsistency, so I wanted to ask David whether there were a bug (if I remember correctly, David added the possibility to use different angles of positioning to his initial filter, so maybe some "piece" of the modification/enhancement contains a bug...).

_________________
"Where am I ?"


Top
 Post subject: Re: experimenting Pack Sprites. Is there a BUG?
PostPosted: Mon Oct 12, 2015 6:40 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
not to multiply Topics I insert here a subtopic: PERFORMANCE still relatively to this G'MIC filter:
in case you David open the code to check whether there is or not a bug related to the "degrees", could you just get an eye whether it could be possible (maybe not) to improve performances?
on my current PC (not a bad one, Intel Icore5 with SSD as primary disk) I get the following results:
-input is the same image as per initial topic, but the set of sprites is composed only with 9 flowers
-test have been made with 3 different image sizes: 500, 1000 and 2000
to get the outcomes the elapsed times were:
- 45 seconds on the 500 image
- 210 seconds on the 1000 image
- 995 seconds on the 2000 image
results were all very nice (I continue using the 0 degree option, to avoid problems)

_________________
"Where am I ?"


Top
 Post subject: Re: experimenting Pack Sprites. Is there a BUG?
PostPosted: Sat Oct 24, 2015 1:13 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
NOT SOLVED in new release 1.6.7

same image, same sprites, same set-ups

result using degree=0 (OK, as before)
Attachment:
Fruit-Alphonse-Mucha_BG_pack_sprites 10,10,0,-7,7,1_new.png
Fruit-Alphonse-Mucha_BG_pack_sprites 10,10,0,-7,7,1_new.png [ 2.35 MiB | Viewed 4542 times ]


result using degree=any (BAD, as before)
Attachment:
Fruit-Alphonse-Mucha_BG_pack_sprites 10,10,3,-7,7,1-new.png
Fruit-Alphonse-Mucha_BG_pack_sprites 10,10,3,-7,7,1-new.png [ 1.94 MiB | Viewed 4542 times ]


Performances: very slow (as before)

_________________
"Where am I ?"


Top
 Post subject: Re: experimenting Pack Sprites. Is there a BUG?
PostPosted: Sat Oct 24, 2015 3:30 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
I suspect your letters to be too big.
When I reduce their size before applying the filter, it works for me.
Also, the filter is slow indeed, because packing is a quite difficult problem and you cannot get an easy solution without a lot of iterations.
I don't think I can do anything about it.

Attachment:
Fruit-Alphonse-Mucha_BG_works.jpg
Fruit-Alphonse-Mucha_BG_works.jpg [ 1002.68 KiB | Viewed 1745 times ]


Top
 Post subject: Re: experimenting Pack Sprites. Is there a BUG?
PostPosted: Sat Oct 24, 2015 4:40 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
your suspect is quite reasonable, even if the size is not so big (150*130), but my question stays there:
- why does it work properly if I choose degree=0 and not if I choose degree=any?
the size is the same, the parameters also

edit: my "suspect" is still on the code added to implement the "any degree" function, on request of some user (I guess Lyle); the "original" code - which works with "0 degree" - behaves properly
don't you have the same "suspect", David?

_________________
"Where am I ?"


Top
 Post subject: Re: experimenting Pack Sprites. Is there a BUG?
PostPosted: Sat Oct 24, 2015 9:23 pm  (#13) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
David, maybe I discovered the problem in the algorythm:
- the parameter "minimal scale %" is NOT taken into account when selecting "all degrees", while it is appropriately taken into account when selecting "0 degrees".
New test:
- as a base image just a squared hole (440*440) surrounded by a frame (image 640*640)
- as sprites a series of letters (only a few) with a quite big size (300*261)
- parameters: 10 numbers of scales, 10 minimal scale %, mask as bottom layer

Test1: option "0 degrees" : excellent outcome, sizes have been appropriately reduced to fit in
Test2: option "any degrees" : outcome with just one letter, NOT rescaled

Attachments:
- outcome of Test1
- outcome of Test2


Attachment:
SquareHole_PackSprite0Degree.png
SquareHole_PackSprite0Degree.png [ 204.16 KiB | Viewed 1723 times ]

Attachment:
SquareHole_PackSpriteAnyDegree.png
SquareHole_PackSpriteAnyDegree.png [ 70.69 KiB | Viewed 1723 times ]


hope this info can be useful

_________________
"Where am I ?"


Top
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group