Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / Image Kit V2

Author
Message
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 1st Oct 2010 18:48 Edited at: 1st Nov 2010 17:34
Hello everyone,

I decided to release a beta version of the new version of Image Kit. For those that use the previous version: I think you can copy the DLL alongside the other version in order for your old programs to work that use this DLL. Mainly because target image support is dropped for filters, I decided to give this DLL another name (also, the commands now have a prefix 'IK' to avoid conflicts).

[edit] Link to the previous version: Image Kit v1.*

Now for the new version's features:

FEATURES
Create/copy/edit normal and target images.
Use filters to change the appearance of normal images, or effects (pixel shaders) that you can load for target images.
Paste images on other images or on the screen using blend modes and shaders (in case of a target image or the screen). You can rotate, or stretch the image when rendering.
Draw gradients on a normal image.

LIST OF COMMANDS


Notes:
- The help files are semi-auto-generated (I made a program that generates the help files based on the commands, parameters & descriptions I gave it. Unfortunately I didn't include a way to handle functions that return a value, so those help files have a "Return" parameter which obviously is the parameter that should be returned. Sorry for the inconvenience.
- I have not yet tested this program for every command. If any of you would find a bug, please tell me. It will make my job a little easier.
- The plugin comes with 2 examples that use the shader system. One is a Julia/Mandelbrot fractal viewer using IK paste image on image (the target image is a sort of buffer). The second one is a simple scene where the camera output is pasted onto the screen using a shader (3 versions of desaturation & 2 distortions, where one is using a distortion map).

Screenies:

- Scene - example (included with download)

FPS is capped at 85

No shader, no technique


Desaturate shader, Lightness


Distortion shader, mapped with a second texture

- Fractal - example (include with download)


Zoom.


Zoomed, use right mousebutton to move, use space to reset.

I haven't got the time to make more examples, but I think it shows enough of the possibilities.

Note to all:

This plugin can now be found in the program announcement board:
http://forum.thegamecreators.com/?m=forum_view&t=177340&b=5

Cheers!
Sven B

Grog Grueslayer
Valued Member
18
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 1st Oct 2010 19:41
Wow, those are real nice commands. I tried some of them out and they work great but when I use Fullscreen Exclusive it always errors out. In all the window modes they work perfect and FAST. Good job!

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 2nd Oct 2010 00:26
Thanks! And thanks for pointing that out . Would it be possible to give some code (if you changed any) or specify how and which error you get? (Well pretty much as much information as you can ) I didn't manage to reproduce the error. I did set the mode to fullscreen in my editor, but it ran without error here.

Cheers!
Sven B

Grog Grueslayer
Valued Member
18
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 2nd Oct 2010 03:43
I figured out that SET DISPLAY MODE is what's really messing it up in Fullscreen Exclusive. When I use it I just see a blank screen with the mouse cursor (without an error really). I tried using IK RESET IMAGE KIT after SET DISPLAY MODE and it errors out (see attached image). With SET DISPLAY MODE remed off it works fine.



I'm using Vista 64 bit if that helps. Even with it messing up I'm still impressed at how fast it changes the images.

Attachments

Login to view attachments
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 2nd Oct 2010 12:21 Edited at: 1st Nov 2010 17:18
Hi Grog,

Thanks! I manged to find a fix for the problem. The new DLL is attached to this post, or you can download the whole package again at the first post. [edit] download removed.
Before, I created some things along with DBP automatically, but it seems that that part crashes when using set display mode in full screen exclusive mode. Instead I decided to create the media the first time it's needed (when rendering).



This change also means that IK Reset Image Kit can be left out in some cases like in this example, because the media is only created at IK paste image rotated. But I suggest to use this command nonetheless to avoid crashes.

Cheers!
Sven B

Grog Grueslayer
Valued Member
18
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 2nd Oct 2010 22:14
Cool, works like a charm! Thanks.

Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 3rd Oct 2010 15:18
Amazing work.

Sixty Squares
17
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 3rd Oct 2010 17:13 Edited at: 3rd Oct 2010 17:13
Awesome.

That bit about pixel shaders seems especially useful-- I'll have to play around with it when I get the chance


Guns, cinematics, stealth, items and more!
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 5th Oct 2010 13:01 Edited at: 5th Oct 2010 13:01
Thanks ! Your comments really make my day lately :-P.

I consider this plugin to be in its (beta) final version. If I can't find any bugs within 1 or 2 weeks, I will move it to program announcements.

Cheers!
Sven B

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 7th Oct 2010 04:54 Edited at: 7th Oct 2010 04:55
@Sven B:

Tried a few commands from your plugin and I noticed some errors.



Gives me the error: "Could not lock image." This command: "IK Gradient Radial" can't be executed more then once for some reason.

Certain shaders (for instance the shaders from Dark Shader) gives me an error. (Image is attached) (I don't know if they are pixel shaders or not. They are the full screen shaders from Dark Shader)

Other then that AMAZING plugin.

I would suggest adding a few more commands:
- Dot3 (like from extends)
- Heightmap (I have the code. It is very simple if u would want it)
- Normal Map (Dot3 + HeightMap + Lighting)
- Perlin Noise or Diamond Square Algorithm (Control the octaves, smooth, and other variables)

Looking forward to seeing what commands you include in your next release. ^^

Digital Fury

Attachments

Login to view attachments
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 7th Oct 2010 15:17 Edited at: 1st Nov 2010 17:19
Hi DigitalFury,

Quote: "Gives me the error: "Could not lock image." This command: "IK Gradient Radial" can't be executed more then once for some reason. "


This one is my fault. A fixed DLL is attached (and uploaded to the first post if you wish to download the full package). [edit] Download has been removed.

Quote: "Certain shaders (for instance the shaders from Dark Shader) gives me an error. (Image is attached) (I don't know if they are pixel shaders or not. They are the full screen shaders from Dark Shader)"


This kind of error is a compile error. When the program finds a compile error, it will show you that error on the screen. Have you tried changing any lines that look like this:
- *****Shader = compile ps_1_* Function();
to this:
- *****Shader = compile ps_2_0 Function();
?

You should be careful when using shaders used by DarkShader. It is possible that some things are possible in DarkShader or DBP, while they're not possible in ImageKit. A simple example would be the semantic:
Texture g_Tex <string Name="file.bmp">
DBP can find 'Name' and will load that texture for you internally (and will assign it to the effect etc.), but this kind of feature is not a default feature of effects. ImageKit only supports the default features of effect files.

Quote: "I would suggest adding a few more commands:
- Dot3 (like from extends)
- Heightmap (I have the code. It is very simple if u would want it)
- Normal Map (Dot3 + HeightMap + Lighting)
- Perlin Noise or Diamond Square Algorithm (Control the octaves, smooth, and other variables)"


I am already working on such a plugin. But I decided not to add those commands to ImageKit. Instead I chose to compile a new DLL (called ImageGen ~ for obvious reasons) that will render such images like you're suggesting.
Also, I think some of the items on your list are possible using a pixel shader (the learning curve for that shouldn't be too steep).

Current items on the list for ImageGen:
- Random
- Diamond Square (seamless)
- Perlin Noise
- Voronoi Diagrams
- Simple thermal and hydraulic erosion functions for procedural terrain generation
- Possibly more functions in the line of terrain generation
- Possibly a function generator (like "sin((x - 256)^2 + (y - 256)^2)"

Cheers!
Sven B

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 7th Oct 2010 23:08
@Sven B - The DLL wasn't updated in the first post. Tried the DLL in the latest post and it worked just fine.

Quote: "I think some of the items on your list are possible using a pixel shader"


That's true. I was able to get the normalmap.fx working.

I haven't looked into shaders yet. You could explain what makes Image Kit's Shader Compiler different from DBP's in the help file. I might just learn how to use shaders so I can generate the Normal Map, Depth Map, Shadow map, and other dynamic images I need.

ImageGen sounds amazing. I just started working on Diamond Square a bit and looked into erosion algorithms. Can't wait for this plugin! Saves a lot of work and math. lol

Thanks,

DigitalFury
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 7th Oct 2010 23:37
Quote: "The DLL wasn't updated in the first post. Tried the DLL in the latest post and it worked just fine."


Thanks. I must've forgotten to copy the new DLL in the zip file.

Quote: "I haven't looked into shaders yet. You could explain what makes Image Kit's Shader Compiler different from DBP's in the help file. I might just learn how to use shaders so I can generate the Normal Map, Depth Map, Shadow map, and other dynamic images I need."


Sure. The help files need a thorough check anyway (The current ones were automatically created by a program in DBP I wrote in a day or two). You can start by searching the internet and go through the small pixel shaders I wrote for ImageKit.

Cheers!
Sven B

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 16th Oct 2010 05:51
@Sven B - I am trying to figure out how to not draw black on an image when using Dot and Gradient commands.

Here is what I tried:


It didn't work.


Thanks for your help!

Digital Fury
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 17th Oct 2010 03:03
Hi DigitalFury,

Why not try to use the gradient on the alpha channel? I might not really understand what you want to achieve though...

Cheers!
Sven B

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 18th Oct 2010 01:08
I am trying to do the same thing that: "SET IMAGE COLORKEY" does but on an image. I figured it wouldn't work for what I am doing. I have to combine colors like a brush. I had to add individual pixels to accomplish this.

Digital Fury
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 18th Oct 2010 10:36
This looks good. If this lets you resize images with better quality than DBP, it's worth it for this one feature alone
Is this based on Image Magick? I once looked at trying to get the resize image commands to work from IM, but making a wrapper was beyond my ability.

Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 22nd Oct 2010 18:08
Great plugin, I especially like the refraction effect. So many possibilities, so little time .

Health, Ammo, and bacon and eggs!
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 22nd Oct 2010 21:32
I tested the resize, it does a really good job.

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 23rd Oct 2010 00:31
Quote: "Is this based on Image Magick? I once looked at trying to get the resize image commands to work from IM, but making a wrapper was beyond my ability."


It isn't. All functionality is coded from scratch (I am using Direct3D/X though, kind of obvious).

Thanks for your compliments!

I'm pretty busy lately, so I don't really have that much time left to get into programming (again :-().

Cheers!
Sven B

OldPMan
TGC Store Seller
15
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 23rd Oct 2010 01:35
Very useful plugin. Thanks. To me he's just really need.

.....already beside..... for all
OldPMan
TGC Store Seller
15
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 25th Oct 2010 12:12 Edited at: 25th Oct 2010 12:17
I have a question.
Could not, would you add multiple commands to copy and paste images to form a triangle ?
thanks.

.....already beside..... for all
OldPMan
TGC Store Seller
15
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 25th Oct 2010 21:45 Edited at: 25th Oct 2010 21:58
Quote: "Could not, would you add multiple commands to copy and paste images to form a triangle ?"


I'm actually not just set the previous question. I shield is relevant because Working with images is to use these images as textures and textures superimposed on the object to triangles and copying parts of the image as a rectangle may not be suitable for such purposes. I'm using your plugin with the commands DOT and POINT but copying is a long time.
in any case, many thanks for great plugin.
with respect RUSSIA.

.....already beside..... for all
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 26th Oct 2010 17:09
Hi Russia,

Pasting triangles feels too specific to add it as a feature. I don't think many users would use such a feature.
You can use masks if you want though. Draw a white triangle on a black image, and then paste the image channel onto the image you want to mask. Finally you can just paste the masked image wherever you want.

Cheers!
Sven B

OldPMan
TGC Store Seller
15
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 26th Oct 2010 17:43
I understand you.
very sorry.
Unfortunately it takes even more time than copying by DOt and POINT.
it should be done first image and then draw a triangle (which is the same as copying by DOt and POINT.), then copy.
but this procedure I need to spend from 1,2 up to 1500. (Number of triangles in the objects)
I think for me it would be too long. I find it easier to use DOt and POINT.

Cheers!
Russia

.....already beside..... for all
knxrb
FPSC Tool Maker
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: United Kingdom
Posted: 29th Oct 2010 21:53 Edited at: 29th Oct 2010 21:57
The documentation for the 'IK Paste Image On Image' has confused me.
I want to paste an image onto another with a specific width and height but I can't understand in what order the arguments are supposed to go:

The documentation for the command:


Can't you just make one like this?:


Or maybe:


Whatever order arguments I try the image doesn't paste onto the image, the original image stays as it is with no images pasted onto it.

Although when I use the command as 'IK Paste Image On Image Image Number, Target Image, Left, Top' it works perfectly and pastes the image but it's the normal image's size.

knxrb
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 29th Oct 2010 22:52 Edited at: 29th Oct 2010 22:54
Yeah sorry, the documentation isn't really all that (auto-generated).

Anyways:
IK Paste Image On Image has the parameters
Image Number, Target Image, Left, Top for normal images. Any other combination of parameters only work on target images. If nothing happens, then it means that the command expected a target image while it wasn't.

The parameters are a bit mixed. I really gotta fix those help files some time. I'm planning to rewrite them one by one.

Cheers!
Sven B

knxrb
FPSC Tool Maker
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: United Kingdom
Posted: 30th Oct 2010 13:21
Ahh, thanks, so I can't paste images onto other images with a specific width and height at all then?

knxrb
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 1st Nov 2010 17:17 Edited at: 1st Nov 2010 17:34
Quote: "Ahh, thanks, so I can't paste images onto other images with a specific width and height at all then?"


You can, if those images are target images.
Basically:
image -> normal image = okay
image -> target image = okay
image --stretched--> normal image = not okay
image --stretched--> target image = okay
image --rotated--> normal image = not okay
image --rotated--> target image = okay

Note to all:

I've decided to move this plugin to the program announcements board. The help files have been reviewed and I think I've handled most bugs I could find. I'm not planning on making any significant changes to this plugin.

[edit]
This plugin can now be found in the program announcement board:
http://forum.thegamecreators.com/?m=forum_view&t=177340&b=5

Cheers!
Sven B

tomfromvienna
13
Years of Service
User Offline
Joined: 3rd Feb 2011
Location:
Posted: 3rd Feb 2011 14:32
Hi all,

I got a strange problem with the Image Kit.
After i first installed it, it gave a message that some d3d-dll was missing.
i installed the latest DirectX-runtime, and now everytime i start a programm containing any keyword from the image kit, it stops with an error "Setup Debug DLL could not be loaded".

Also tried to install the newest DX-SDK, did not help...

Any ideas what i did wrong?
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 3rd Feb 2011 16:58 Edited at: 3rd Feb 2011 16:59
Hi tomfromvienna,

The missing D3D dll could've indeed been caused by not having the latest DirectX version.
The error "Setup Debug DLL could not be loaded" is an error you get if the SetupDebugDLL.dll (a default DBP dll) wasn't linked to your executable. Try reinstalling or updating DarkBasic Pro and see if it solves your problem.

[edit] I'm not sure you noticed, but this thread should have been moved to the program announcements (see link in the bottom of my first post).

Sven B

tomfromvienna
13
Years of Service
User Offline
Joined: 3rd Feb 2011
Location:
Posted: 3rd Feb 2011 22:49
Hi Sven,

thank you for the fast reply.
Could it have to do with my recent update to U76 of DBP?
Should your plugin work with this release?

Thanks again.
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 4th Feb 2011 18:58
No problem.
Right now I've updated to 7.7 beta, but I was using 7.6 before that and I didn't have any problems with it. This simple example works on my computer:


However, if the error is indeed "Setup Debug DLL could not be loaded" then it doesn't have much to do with the internals of the plugin. It's an error that is only shown when the setup dll (which holds core commands) couldn't be loaded. Perhaps you could double check that you have "DBProSetupDebug.dll" in DarkBasic Pro/compiler/plugins. If it has a different name it could lead to that error...

Sven B

Coldfire
15
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 23rd Feb 2011 04:15
Hello Sven B,

I'am also having the same problem as tomfromvienna. I am using 7.6 and have also verified that the "DBProSetupDebug.dll" file is in my plugin directory, but the problem still persists. It only happens when using a IK command. I just switched to this from IK v1 and did not have the same problems with that one. Please lemme know if you figure out the problem. Thanks and keep up the good work!

Randy
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 9th May 2011 02:01
This is incredible!

Login to post a reply

Server time is: 2024-03-29 14:30:46
Your offset time is: 2024-03-29 14:30:46