New Image plugin available for beta-testing

Developed or developing a new product in PureBasic? Tell the world about it.
Ginger
New User
New User
Posts: 8
Joined: Tue Jun 28, 2005 4:50 am
Location: Edmonton, Alberta, Canada eh!
Contact:

Post by Ginger »

Hi,
Very much a newbie here... is there a help file available yet?
Ginger

***********************************
So say... a man called Ginger. Yes, I'm a dude.
pantsonhead
User
User
Posts: 39
Joined: Fri Mar 26, 2004 1:47 pm
Location: London, UK
Contact:

Welcome aboard

Post by pantsonhead »

Hi Ginger

Download it from here:
http://www.purearea.net/pb/download/use ... LE_2.3.zip

Unzip it in your PureBasic folder so that the library file goes into
C:\Program Files\PureBasic\PureLibraries\UserLibraries
and put the EC_ImagePluginOLE.chm help file into
C:\Program Files\PureBasic\Help

(NB: your installed path may be different)

There's some example code in the zip file too.


Compile this for a very basic gif2jpg app.
Drag a .gif file onto the compiled exe and it will render as jpg.

Code: Select all

Enumeration
  #imgGif
EndEnumeration

UseEC_OLEImageDecoder()
UseJPEGImageEncoder()

; check for command line parameters
filename.s = Trim(ProgramParameter())
If filename <> ""
  If LoadImage(#imgGif, filename) ;load this image
    filename=ReplaceString(filename,".gif",".jpg") 
    SaveImage(#imgGif, filename ,#PB_ImagePlugin_JPEG, 9 ) ;save as jpg
    FreeImage(#imgGif)
  EndIf
EndIf
There's quite a few user-libs here: http://www.purearea.net/pb/english/index.htm
Ginger
New User
New User
Posts: 8
Joined: Tue Jun 28, 2005 4:50 am
Location: Edmonton, Alberta, Canada eh!
Contact:

Post by Ginger »

Hey, thanks very much pantsonhead! (Hehe, love that name :lol: ) This plugin will be veerrrry handy.

Cheers
Ginger

***********************************
So say... a man called Ginger. Yes, I'm a dude.
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

Just a side note.. (didnt read your posts sorry) the GIF licence expired some time ago... so no trouble whatsover. Its just a myth on the net now and I guess not many persons got the good news (although as el choni stated, it IS quite obsolete) for some reason some programmers still like them.. and want support for them though.
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

I don't suppose there's a chance this fella can decode png, is there? It'd be nice to just use this image library instead of having to use the decode png library as well. My program jumps like 90kb just for using the png library >_>
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Any chance this could be updated to PB4?
zued
User
User
Posts: 27
Joined: Wed Dec 17, 2003 11:20 pm

Post by zued »

.PPM support ?

/svensken
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

I have a PPM plugin, I haven't tested it with PB4, I'll tell you this evening when I'm home.
El_Choni
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

I only had to change the BSS section, it works:

http://www.inicia.es/de/elchoni/EC_ImagePluginPPM.zip

To use it:

Code: Select all

UseEC_PPMImageDecoder()
UseEC_PPMImageEncoder()
To save:

Code: Select all

SaveImage(0, FileName$, 'PPM')
I also have plugins for PBM, PGM, XPM, XBM, WBMP and IFF, just in case somebody needs those.

Regards,
El_Choni
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

IFF format is super helpful over here :) Thank you El_Chroni .. I'll run the plugin against PB4 when I get home.
zued
User
User
Posts: 27
Joined: Wed Dec 17, 2003 11:20 pm

Post by zued »

El_choni... Thanks. Workes great!

/svensken
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

BTW, forgot to tell you, it saves in PPM/P3 by default (loads both P3 and P6). If you want to save in P6 format, use:

Code: Select all

UseEC_P6ImageEncoder()
;
SaveImage(0, FileName$, 'P6')
And here's the IFF plugin:

http://www.inicia.es/de/elchoni/EC_ImagePluginIFF.zip

The decoder is always thread safe, but the encoder isn't. The decoder supports classic palete IFF, IFF 24, ILBM, PBM, HB, EHB, HAM5-6-7-8-10 (although I haven't found any HAM 5-7-10 to test it, it should work).

It only encodes in IFF24.

To use:

Code: Select all

UseEC_IFFImageDecoder()
UseEC_ILBMImageEncoder()
;
SaveImage(0, FileName$, 'ILBM')
Enjoy it,
El_Choni
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

damn thats awesome :) And threadsafe to boot! The new jpeg decoder for pb4 only adds 30K instead of 90K(?) like previous versions. However, yours have alot more decoding power :)
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

Ok, IFF encoding is also threadsafe now:

http://www.inicia.es/de/elchoni/EC_ImagePluginIFF.zip
El_Choni
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

G'day El_Choni, do you have an updated package containing all the decoders that support pb4?
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Post Reply