Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
program that stitches together a bunch of image files into one giant poster?
#1
Before I go and reinvent the wheel, I'm wondering if this or something similar already exists...? 

I'm thinking a program that 
  • looks in a directory like "c:\Users\MyUser\Pictures"
    (extra points if it can handle environment variables like "%USERPROFILE%\Pictures") 
  • finds all images (extra points if it lets you specify 1 or more wildcards to match like "*.jpg;*.png;*.gif")
  • gets the size of all of them and figures out (based on layout chosen) how big the final image will be & initialize it
    (I'm not sure what kind of limitations QB64PE has for image size, I am thinking this prog would limit the size only based on the computer memory & hard drive space)
  • for each pic:
    loads it into memory,
    resize/scale/rotate (depending on options)
    copies to a new giant image (depending on the layout you choose,
    e.g., if we have 16 pictures, maybe 4 columns x 4 rows, or 8 columns x 2 rows)
  • outputs a new image file in the selected format. 

I'm thinking of some fancy features like if the pictures are different sizes, it can resize them / rotate them / stretch them, depending on what you can choose, to whatever the largest common dimension is, or maybe it can detect a picture's orientation, and auto rotate so they are all landscape or portrait, or figure out how to lay them out so there is minimal blank space. 

Maybe an option to not rotate but fill in the blank space with a given background color, or if there are not enough pics for an even # of rows/columns, fill in empty areas with some default color or pattern.

Some of the things I'm going to have to figure out how to do for this include 
  • list files from a folder
  • match based on *? wildcards
  • load an image file into a _NewImage
  • detect image height/width
  • rotate image
  • scale/resize image
  • stretch/skew image
  • display an image bigger than the screen shrunk down to fit the screen (to preview on screen)
  • save image from memory to a file

Simple use cases: 
  • make a pic collage for your PC's desktop 
  • take a bunch of pictures and turn them into a poster you can have printed at somewhere like CVS (the web site says 24"x36" is $15.99 ?!)
  • make a background for a game

Has anyone seen or done anything like that?
Reply
#2
Interesting idea. Look here https://qb64phoenix.com/forum/showthread.php?tid=3086, from the last source code select SUB LoadFiles and all the necessary SUB, Declare Library and Functions that DirEntry.h needs (it's in the ZIP file). LoadFiles takes all images from a folder and tests them for validity and usability in QB64. The rest of what you describe, you really have plenty of room for imagination and for various effects. Use the _Width and _Height functions to find out the dimensions of images, the latest IDE has the SaveImage function to save them in many formats. Also look at the _File$ function, you might be able to use that to search for images on disk.

For image rotation find RotoImage in the forum.


Reply
#3
(10-23-2024, 08:29 PM)Petr Wrote: Interesting idea. Look here https://qb64phoenix.com/forum/showthread.php?tid=3086, from the last source code select SUB LoadFiles and all the necessary SUB, Declare Library and Functions that DirEntry.h needs (it's in the ZIP file). LoadFiles takes all images from a folder and tests them for validity and usability in QB64. The rest of what you describe, you really have plenty of room for imagination and for various effects. Use the _Width and _Height functions to find out the dimensions of images, the latest IDE has the SaveImage function to save them in many formats. Also look at the _File$ function, you might be able to use that to search for images on disk.

For image rotation find RotoImage in the forum.
Sounds promising - thanks for all that info! 
I'll post some code as soon as I have something working.
Reply
#4
Well, sort of. Once I put together a pic of Steve and a farm animal. It was costly. I had to rent a tractor to pull them apart! Big Grin 

This sounds like a lot of sub-general AI work if you're not intending to slave a lot of it out. I don't recall in 30+ years, working with QB, of ever hearing of such a project; so I think you have a pretty unique idea. You're young, right?

Pete
Shoot first and shoot people who ask questions, later.
Reply
#5
maybe this https://download.cnet.com/download/image...07152.html
or from https://web.archive.org/web/201902230502...indows.msi 64-bit
https://web.archive.org/web/201903092219...indows.msi 32-bit

I used it eons ago and it worked quite well back then
Reply
#6
(10-23-2024, 10:50 PM)Pete Wrote: Well, sort of. Once I put together a pic of Steve and a farm animal. It was costly. I had to rent a tractor to pull them apart! Big Grin 

This sounds like a lot of sub-general AI work if you're not intending to slave a lot of it out. I don't recall in 30+ years, working with QB, of ever hearing of such a project; so I think you have a pretty unique idea. You're young, right?

Pete
LoL young? Is this going to take years to finish? 

Youth is relative - I missed out on the days of punch cards and paper tape, but just for reference, I was introduced to computers and BASIC programming in middle school on the TRS-80 Models 1 & III, and my first computer was a 16k Texas Instruments TI99/4A ($49.99 on clearance from K-Mart!) with a cassette recorder. The year after, upgraded to a Commodore 64 and was off to the races! 

Anyway, hopefully we'll see some kind of working prototype in the next week or 2, with luck!
Reply
#7
(10-24-2024, 12:19 AM)Jack Wrote: maybe this https://download.cnet.com/download/image...07152.html
or from https://web.archive.org/web/201902230502...indows.msi 64-bit
https://web.archive.org/web/201903092219...indows.msi 32-bit

I used it eons ago and it worked quite well back then
Thanks Jack, I'll check those out! 

BTW does anyone know when archive.org will have the archived software, videos, music & other content back up? I sorely miss all that stuff! Dang hackers, go pick on someone worth picking on!
Reply
#8
So that's why K-Mart was out of stock when I showed up!

I only posted that because I actually did buy exactly that model as my first computer and it was purchased from K-Mart.

Pete Big Grin 

- It's a small world, so there will be plenty of opportunities to boot Clippy in the ascii.
Reply
#9
(10-24-2024, 01:18 AM)Pete Wrote: So that's why K-Mart was out of stock when I showed up!

I only posted that because I actually did buy exactly that model as my first computer and it was purchased from K-Mart.

Pete Big Grin 

- It's a small world, so there will be plenty of opportunities to boot Clippy in the ascii.
Haha beautiful! 
LoL
Reply
#10
imagemagick convert.
https://imagemagick.org/script/convert.php

example:
Code: (Select All)
# horizontal:
convert *.jpg +append output.jpg
# vertical:
convert *.jpg -append output.jpg

replace the *.jpg and output.jpg with your desired formats/filenames.

Code: (Select All)
convert %1.png -alpha set -channel RGBA -fuzz 1%% -fill none -floodfill +0+0 black -interpolate nearest -interpolative-resize 400%% %1-rs.png

In the above example, it sets alpha, sets snap for colors (fuzz), sets no fill, fills with transparency, interpolates as nearest (pixelized) and resize to 400%. if you wanted to do this for a batch you'd use:
Code: (Select All)
convert *.png -alpha set -channel RGBA -fuzz 1%% -fill none -floodfill +0+0 black -interpolate nearest -interpolative-resize 400%% -append spritesheet.png
(or +append) if you want horizontal
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply




Users browsing this thread: 1 Guest(s)