Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3

Author Topic: Tileset Resizer v2.5 - Now With hqx -> v3.0 Mac Beta Testers Needed  (Read 783470 times)

nukularpower

  • Bay Watcher
    • View Profile
Re: Tileset Resizer v2.5 - Now With hqx -> v3.0 Beta Testers Needed
« Reply #15 on: January 30, 2012, 05:01:30 pm »

Will definately give this a try later.
Logged

arclance

  • Bay Watcher
    • View Profile
Re: Tileset Resizer v2.5 - Now With hqx -> v3.0 Beta Testers Needed
« Reply #16 on: January 31, 2012, 12:39:39 pm »

Will definately give this a try later.
I hope you like it.
If you are making larger tiles would you like to beta test the multithreaded version of resize_tileset_hqx_tilebytile?
It is significantly faster than the old version but I need some people to test it on various systems before I make a public release.
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

Ghills

  • Bay Watcher
    • View Profile
Re: Tileset Resizer v2.5 - Now With hqx -> v3.0 Beta Testers Needed
« Reply #17 on: January 31, 2012, 07:36:30 pm »

I'd be happy to beta-test.  You can PM me about arrangements, or we can talk in this thread.
Logged
I AM POINTY DEATH INCARNATE
Ye know, being an usurper overseer gone mad with power isn't too bad. It's honestly not that different from being a normal overseer.
To summarize:
They do an epic face. If that fails, they beat said object to death with their beard.

arclance

  • Bay Watcher
    • View Profile
Re: Tileset Resizer v2.5 - Now With hqx -> v3.0 Beta Testers Needed
« Reply #18 on: January 31, 2012, 09:03:48 pm »

I'd be happy to beta-test.  You can PM me about arrangements, or we can talk in this thread.
Why don't we talk here.  I just don't want to put the beta up on DFFD until it's tested.

Tileset Resizer v3.0 Beta - Instructions (Beta)

First I need to know some information about your computer for beta testing.

1. What Operating System are you using?
2. How many cores/threads does you processor have?
3. What version of Octave are you using?
4. What version of hqx are you using (1.0 or 1.1)?
5. What tileset are you resizing (so I know what to test with to try and reproduce problems)?

When you use Tileset Resizer I need you to do two things for me.
1. The Beta version outputs some debugging information in Octave, please copy and paste the Octave output here even if you don't have any problems so I can see how well it works for you.
2. If you do run into a problem tell me and I will give you a version with full debug output to try.  It has a lot of terminal output so I don't want to start with that version because it makes it slower.

You will need Octave, hqx, and from Octave Forge the image and general packages.
If you use Window or Mac operating systems you can get installers for Octave at Octave Forge.
Follow the instructions in the readme in the first post on how to install them, the general package is new and installs the same way as the image package.

----Download Tileset Resizer v3.0-Beta Here----

Here are some instructions for using the new features in v3.0.  I haven't written the readme yet so if these don't make sense just ask me for help.
--NOTE--
The functions still have their development filenames (so I can tell the versions apart) so they will need to be called by those names in octave.
Mostly this means that the old functions have a "2" on the end (for now) to indicate the can be called by the batch processing functions.

resize_tileset_hqx_tilebytile2_split_MT_Beta is the multithreaded version of resize_tileset_hqx_tilebytile
a new input variable has been added to resize_tileset_hqx_tilebytile2_Split_MT_Beta to specify how many threads to use.
This is the last input variable given.

Valid inputs are
Code: [Select]
-1 = multithreading disabled
0 = try to automatically choose a sane number of threads to use
1 to number of hardware threads = this many threads will be used
Use of more threads than hardware threads is disabled right now as it most likely will be slower and more buggy.

Here is an example of a correct call of the function.
Code: [Select]
resize_tileset_hqx_tilebytile2_split_MT_Beta('Phoebus_16x16','png',16,16,24,24,'spline',0)
resize_tileset_hqx_tilebytile2 is the old version with some improvements and bug fixes

The other three previous function have added improvements and bug fixes but but are otherwise the same.

New Functions
delete_bg_color2
Replaces a specified rgb color in an image file with black and adds/edits the alpha layer to make pixels of the specified color transparent.
Only png and bmp files are valid for Dwarf_Fortress but tiff files also support an alpha layer.
Solves the bug from this post
The standard purple/magenta background seen in tilesets is R=255 G=0 B=255.

Here is an example of a correct call of the function.
Code: [Select]
delete_bg_color2('hexed_12x12','bmp',255,0,255)
delte_bg_color_batch
Batch processes all files of the specified type using delete_bg_color2
Only png and bmp files are valid for Dwarf_Fortress but tiff files also support an alpha layer.

Here is an example of a correct call of the function.
Code: [Select]
delete_bg_color_batch('bmp',255,0,255)
tileset_resizer_batch
Batch process all image files of the specified file type with the specified Tileset Resizer Function with given inputs.
All tilesets being process must have the same original tilesize.

These are the defined inputs
Code: [Select]
tileset_resizer_batch(file_type,x_tile,y_tile,tile_x_size,tile_y_size,interp,fun_sel,mt_select=-1)And their definitions
Code: [Select]
# file_type is the file type to process
# x_tile is the width of a single tile measured in pixels
# y_tile is the height of a single tile measured in pixels
# tile_x_size = width in pixels to resize the tiles to. ex. 24
# tile_y_size = height in pixels to resize the tiles to. ex. 24
# interp can be ('nearest','linear','bilinear','cubic','bicubic','pchip','spline') spline, cubic, or bicubic should give the best results for hqx functions, nearest is recomened for the other two functions
# fun_sel selects which tileset resizer function to use 1 = resize_tileset, 2 = resize_tileset_tilebytile, 3 = resize_tileset_hqx, 4 = resize_tileset_hqx_tilebytile
# mt_select determines if multithreading will be used for resize_tileset_hqx_tilebytile (-1 to not use multithreading), if it is used it determines how many thereads to use

Here is an example of a correct call of the function for a tileset that started with 16 pixel by 16 pixel tiles to resize them to 24 pixel to 24 pixel tiles.
Code: [Select]
tileset_resizer_batch('png',16,16,24,24,'spline',4,0)All tilesets to be processed at the same time must have the same pixel dimension tiles (all 16 pixel by 16 pixel tiles).
tileset_resizer_batch can process tilesets with different tile dimensions (ex. the standard 16x16 grid tileset and a say 12x36 creature tileset both with 16 pixel by 16 pixel tiles).

Update: Windows users -- Multithreading Does Not Work In Windows --
Multithreading does not works on Windows machines due to pipe not working (breaks the multithreading kludge that is used to get around octaves single threadedness).
Calls should be made like this to instruct Tileset Resizer to use the single threaded version of resize_tileset_hqx_tilebytile.
Code: [Select]
resize_tileset_hqx_tilebytile2_split_MT_Beta('Phoebus_16x16','png',16,16,24,24,'spline')
Code: [Select]
tileset_resizer_batch('png',16,16,24,24,'spline',4)
I can't fix this myself as I did not write the multithreading framework I am using (parcellfun() from the general package from Octave Forge) and it is what is broken on Windows.
If anyone know how to fix the problem let me know and I will see what I can do to make it work on Windows.
More information can be found in this post.

All other functions are not called directly by the user so they do not require instructions.

If you have any questions just ask me.
« Last Edit: March 25, 2012, 09:37:44 pm by arclance »
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

Ghills

  • Bay Watcher
    • View Profile
Re: Tileset Resizer v2.5 - Now With hqx -> v3.0 Beta Testers Needed
« Reply #19 on: February 01, 2012, 10:04:42 pm »

Well, I can test on Vista and Windows 7 (I'm upgrading in the near future).

Processor is has at least two threads - I've misplaced the spec sheet, I'll find it sometime this week.

I'd try resizing all the major tilesets, plus whatever I happen to have lying around.  So Phoebus, Ironhand, Mayday and then I have a couple others I thought were nifty, I'll get their names up here also.

I need to install Octave and hqx, I'll probably run the latest version of both unless there's some special reason not to.  Will the finished package install them for the end-user?

I'm going to be busy this week, but I'll run a test this weekend and post the results here.
Logged
I AM POINTY DEATH INCARNATE
Ye know, being an usurper overseer gone mad with power isn't too bad. It's honestly not that different from being a normal overseer.
To summarize:
They do an epic face. If that fails, they beat said object to death with their beard.

arclance

  • Bay Watcher
    • View Profile
Re: Tileset Resizer v2.5 - Now With hqx -> v3.0 Beta Testers Needed
« Reply #20 on: February 04, 2012, 05:50:37 pm »

Well, I can test on Vista and Windows 7 (I'm upgrading in the near future).

Processor is has at least two threads - I've misplaced the spec sheet, I'll find it sometime this week.

I'd try resizing all the major tilesets, plus whatever I happen to have lying around.  So Phoebus, Ironhand, Mayday and then I have a couple others I thought were nifty, I'll get their names up here also.
Sounds good too me.  I have not had time to test the v3.0 changes in Windows yet so this will be very helpful.
I'm glad you will try multiple tilesets, most of the bugs I found myself only affect certain types of images so they more tilesets you try the better a test it will be.

I need to install Octave and hqx, I'll probably run the latest version of both unless there's some special reason not to.  Will the finished package install them for the end-user?

I'm going to be busy this week, but I'll run a test this weekend and post the results here.
I would always use the latest version of Octave, new versions usually only add features and fix bugs so they don't break scripts written for older versions.
The finished package will not install anything for the end-user that is outside the scope of this project.
It is not feasible to do that for Linux or Mac due the number of Different types of Linux available and my lack of a Mac to test anything on.
Executable installers/pre-compiled versions of Octave and hqx are available for Windows (though the Octave installer does not get updated as often as I would like).
The Octave executable installer for Windows will allow you to select which Octave-Forge packages included in the installer you would like to install.  You can install or update the packages later if you don't use the installer.
Instructions for installing the required programs have always been included in the readme for Windows, Mac, and Linux.
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

arclance

  • Bay Watcher
    • View Profile
Re: Tileset Resizer v2.5 - Now With hqx -> v3.0 Beta Testers Needed
« Reply #21 on: February 08, 2012, 03:16:57 pm »

I'm going to be busy this week, but I'll run a test this weekend and post the results here.
Did you have a chance to run anything over the weekend?
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

Flobulon

  • Bay Watcher
    • View Profile
Re: Tileset Resizer v2.5 - Now With hqx -> v3.0 Beta Testers Needed
« Reply #22 on: February 20, 2012, 12:12:23 pm »

Hey arclance,
I've sent you a PM, just posting here in case you don't see it.
I'll be happy to do any other testing you require! :)
Logged

arclance

  • Bay Watcher
    • View Profile
Re: Tileset Resizer v2.5 - Now With hqx -> v3.0 Beta Testers Needed
« Reply #23 on: February 21, 2012, 01:19:39 pm »

Tileset Resizer v3.0 Beta Results -- Windows --
Flobulon has tested the v3.0 beta on Windows 7 and had the results show below
I tried the new multithread hqx tilebytile function, using the command
Code: [Select]
resize_tileset_hqx_tilebytile2_split_MT_Beta('Phoebus_16x16','png',16,16,24,24,'spline',0)Unfortunately I get the following:
Code: [Select]
octave:3> resize_tileset_hqx_tilebytile2_split_MT_Beta('Phoebus_16x16','png',16,16,24,24,'spline',0)
oct2mat_status = Not loaded
image_status = Loaded
general_status = Loaded
warning: your version of GraphicsMagick limits images to 16 bits per pixel
os = Windows
numProc =  8
tempDir = rgb_alpha
MF =  2
numUsed = Using 6 threads
error: failed to open pipe: pipe: not supported on this system
error: called from:
error:   C:\Octave\Octave3.4.3_gcc4.5.2\Octave3.4.3_gcc4.5.2\share\octave\packages\general-1.2.2\parcellfun.m at line 135, column 5
error:   C:\Users\[me]\Desktop\DwarfFortress\Tileset_Resizer_v3.0-Beta_arclance\resize_tileset_hqx_tilebytile2_split_M
T_Beta.m at line 208, column 1
I got my Windows Vista VM set up and was able to recreate the error.
Code: [Select]
error: failed to open pipe: pipe: not supported on this system
error: called from:
error:   C:\Octave\Octave3.4.3_gcc4.5.2\Octave3.4.3_gcc4.5.2\share\octave\packages\general-1.2.2\parcellfun.m at line 135, column 5
This error indicates that the multithreading function I am using, parcellfun() from the general package from Octave Forge, does not work in Windows.
parcellfun() works by starting more Octaves (one for each thread) to get around the single threaded nature of Octave and then controlling the new Octaves through pipe connections to the original Octave.
Each of the new Octaves runs the same function with a different set of input parameters and then waits for each thread to finish until continuing on in the original script.
Because pipe is not working in Windows the new Octave threads cannot be controlled by the original Octave so parcellfun() doesn't work.
If anyone know some other way to do this in Octave I would appreciate any help you can give me.

Everything else seems to work fine in Windows.
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

arclance

  • Bay Watcher
    • View Profile
Re: Tileset Resizer v2.5 - Now With hqx -> v3.0 Mac Beta Testers Needed
« Reply #24 on: March 26, 2012, 06:03:16 pm »

I still need someone to test the v3.0 Beta on a mac so I can write up the readme for the new version.
I don't have admin privileges on any of the macs here so I can't install Octave to test it myself.
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

Mazth

  • Escaped Lunatic
    • View Profile
Re: Tileset Resizer v2.5 - Now With hqx -> v3.0 Mac Beta Testers Needed
« Reply #25 on: April 16, 2012, 10:44:05 pm »

Thanks so much for this! Looks great on my 24", though the menu now also takes up a lot more space. Might see how other dims looks, using 24x24 now.
Used to zoom in with the mousewheel but my eyes got tired from looking at blurry graphics (or staring at the small tiles).
Tested the tileset first and the difference with the non modified graphicssets was very apparent. Was already used to hqx from emulators and I like the algorhythm.
Also interesting to learn a bit about Octave and the different interpolation methods.
In what language are your scripts written btw?

It appears you don't need win beta testing anymore, but if so, drop me a msg/pm.
(Everything went well with v2.5 on my ancient 1.8 AMD dualcore with octave 3.2.4 and 3.6.1 (forgot to load the libs so tried 3.2.4 first :S) apart from the somewhat long processing times)
Logged

arclance

  • Bay Watcher
    • View Profile
Re: Tileset Resizer v2.5 - Now With hqx -> v3.0 Mac Beta Testers Needed
« Reply #26 on: April 17, 2012, 01:30:27 pm »

Thanks so much for this! Looks great on my 24", though the menu now also takes up a lot more space. Might see how other dims looks, using 24x24 now.
Used to zoom in with the mousewheel but my eyes got tired from looking at blurry graphics (or staring at the small tiles).
Tested the tileset first and the difference with the non modified graphicssets was very apparent. Was already used to hqx from emulators and I like the algorhythm.
Also interesting to learn a bit about Octave and the different interpolation methods.
In what language are your scripts written btw?

It appears you don't need win beta testing anymore, but if so, drop me a msg/pm.
(Everything went well with v2.5 on my ancient 1.8 AMD dualcore with octave 3.2.4 and 3.6.1 (forgot to load the libs so tried 3.2.4 first :S) apart from the somewhat long processing times)
Thanks I'm glad you like it.
I use 20x20 tiles on my 37" tv,  it seems like a good compromise between larger tiles an increasing the size of the menu.

The scripts are written in Octave, which is intended as a open source replacement for Matlab so the languages are very similar.
I used Octave because it had a good image manipulation plugin available, though I had to fix it to work with rgba images and to use some interpolators that had been added to octave since it was written.
Octave's N-D matrices are also very easy to work with and are optimized which makes the script run faster.
hqx is run separate from octave since I don't know c/c++ well enough to completely understand the source code or have enough free time to re-write it as a octave function.

The script runs slower because it has to make so many calls to hqx so I improved this in the beta by multithreading that part of the script but it did not work on Windows.
I am waiting for someone to beta test that on a Mac so I can set up the scripts to only allow multithreading on operating systems where I know it works and so I can write the readme section on the new multithreading feature.

If you are processing the tileset and unit graphics you can download the beta version and use the batch processing scripts in there to make it go a little faster just be sure to not use the multithreading feature.
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

Mazth

  • Escaped Lunatic
    • View Profile
Re: Tileset Resizer v2.5 - Now With hqx -> v3.0 Mac Beta Testers Needed
« Reply #27 on: April 17, 2012, 02:39:13 pm »

(...)
Thanks I'm glad you like it.
I use 20x20 tiles on my 37" tv,  it seems like a good compromise between larger tiles an increasing the size of the menu.

The scripts are written in Octave, which is intended as a open source replacement for Matlab so the languages are very similar.
I used Octave because it had a good image manipulation plugin available, though I had to fix it to work with rgba images and to use some interpolators that had been added to octave since it was written.
Octave's N-D matrices are also very easy to work with and are optimized which makes the script run faster.
hqx is run separate from octave since I don't know c/c++ well enough to completely understand the source code or have enough free time to re-write it as a octave function.

The script runs slower because it has to make so many calls to hqx so I improved this in the beta by multithreading that part of the script but it did not work on Windows.
I am waiting for someone to beta test that on a Mac so I can set up the scripts to only allow multithreading on operating systems where I know it works and so I can write the readme section on the new multithreading feature.

If you are processing the tileset and unit graphics you can download the beta version and use the batch processing scripts in there to make it go a little faster just be sure to not use the multithreading feature.
DF on my tv, excellent idea! My couch is very comfy ^^.
Don't have the menu open in general but when doing things it's a bit invasive; I'll try 20x20 tiles on the beta, the batch function will come in handy there.
Speed is not a big problem, I just run things while afk/playing, but clean and optimized code is always a pre. Too bad multithreading does not work on win, maybe time to switch to lunix :P

Does a run always yield the same result? And would you say spline works best with hqx or is it a bit trail and compare? I find it hard to see a lot of differences between it and your other recommendations (cubic/bicubic).

Thanks for the tips and explantions!

EDIT: I get this msg in Octave 'warning: your version of GraphicsMagick limits images to 16 bits per pixel', is this msg relevant or can it be ignored?
« Last Edit: April 17, 2012, 02:55:15 pm by Mazth »
Logged

arclance

  • Bay Watcher
    • View Profile
Re: Tileset Resizer v2.5 - Now With hqx -> v3.0 Mac Beta Testers Needed
« Reply #28 on: April 17, 2012, 03:25:37 pm »

DF on my tv, excellent idea! My couch is very comfy ^^.
Don't have the menu open in general but when doing things it's a bit invasive; I'll try 20x20 tiles on the beta, the batch function will come in handy there.
Speed is not a big problem, I just run things while afk/playing, but clean and optimized code is always a pre. Too bad multithreading does not work on win, maybe time to switch to lunix :P
My tv is my main monitor, I bought one without fancy extra features, just a VGA hookup so I can have my computer do all the things a more expensive tv would do at a fraction of the price!
Does a run always yield the same result? And would you say spline works best with hqx or is it a bit trail and compare? I find it hard to see a lot of differences between it and your other recommendations (cubic/bicubic).

Thanks for the tips and explantions!
A run should always yield the same result unless there is something wrong with your computer causing data corruption.
Spline or bicubic should be the best options but which is best differs from image to image.
I put up a comparison between the interpolation options for resize_tileset_hqx_tilebytile here.
Comparisons for the other functions can be found in the first post.
EDIT: I get this msg in Octave 'warning: your version of GraphicsMagick limits images to 16 bits per pixel', is this msg relevant or can it be ignored?
That message is just informing you of the limitations of the Graphics Magick that your version of Octave was built against.
It is telling you that you can work with up to 16 bit images.  Most images are 8 bit so you don't need to worry about it.
The warning runs a lot but there is no way to stop it.

There is a quality improvement (converting images to 16 bit before resizing and back to 8 bit before saving them) that I may try to put in the beta version for testing.
The only downside to this is that it increases the memory used by Octave when resizing the image
« Last Edit: April 17, 2012, 04:36:48 pm by arclance »
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

arclance

  • Bay Watcher
    • View Profile
Re: Tileset Resizer v2.5 - Now With hqx -> v3.0 Mac Beta Testers Needed
« Reply #29 on: September 12, 2012, 04:51:12 pm »

Since it has been awhile since I posted here I will post an update on the next version of Tileset Resizer.

Since hqx does not output 16bit images when given a 16bit input image the previously mentioned 16bit resizing trick will not work.

I still need someone to test the multithreaded version on a Mac before I can release the next version.
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext
Pages: 1 [2] 3