New release Image-Viewer for FWH (new functions preview)

New release Image-Viewer for FWH (new functions preview)

Postby ukoenig » Wed Nov 12, 2008 6:20 pm

Hello

I started with a project, to handle a Image-viewer.
There is still something to do but here is the 1. result.
To work on images, you have to get GIMP from the internet.
It is a free graphic-tool and is supported in the application.

Version 2.6.2 - 11.2008
http://sourceforge.net/projects/gimp-win/

Select a Image inside the browser and choose the button < Gimp >.
Gimp will open your selected image.
To get connected to < Gimp >, choose the Gimp-button next to the path
and look for the Gimp-exe-file. The path is stored in a MEM-file.
There is a allready a real-size-preview, to show a image in
a adjusted dialog. Some more functions will follow.
To store your images, use the sub-directory /IMAGE

The source will be in the forum as well, as soon the project is finished.

A update to 1.0a :
The browser-preview shows the full image 1:1 now, if the image < resource.
If the image > resource-size, it is resized, to fit the resource.
( See image : VERTICALTEST.jpg )

Download ( 4.6 MB ) :
http://www.pflegeplus.com/fw_downloads/imgview1.zip

Image

Zoom-functions in next release

Image

Regards
Uwe :lol:
Last edited by ukoenig on Wed Nov 26, 2008 11:57 am, edited 5 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

New Resize-Functions

Postby ukoenig » Thu Nov 13, 2008 9:20 pm

Hello,

New fast-resize-functions are added In version 2.0.

Download Update 2.0 ( 1.2 MB )
http://www.pflegeplus.com/fw_downloads/ImgView2.zip

Images copy to sub-dir /image ( 3.4 MB )
http://www.pflegeplus.com/fw_downloads/Images.zip

The resize-preview works in realtime.
I had a look at < corel paintshop > and < Gimp >, i couldn't find a realtime-preview.
There you have to add the new values and choose OK.
After that action, you can see the new size ( no preview in realtime).
In Gimp i found a pixel-scrolling, but not very useful.

Image

Because the new image-size is smaller than the resource-size,
Dialog-preview and resource-preview are the same.
Image

The image is resized to the resource-size.
The Preview shows the original-size
Image

You can change the values of Width and Height.
Reset will show the original size again.
Image

I would like to save the resized image to disk.
Somebody knows a good solution for this ?

I tested :

hDC := GetDC( oImage:hWnd )
oDlg5:SaveToBmp( "Resized.bmp" )
ReleaseDC( oImage:hWnd, hDC )

but it didn't work.
Could it be maybe possible, to use functions from the < freeimage.dll > ?

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

New Image - Viewer ( preview )

Postby ukoenig » Thu Nov 20, 2008 3:06 pm

Hello,

The new update of the Image-viewer will support any graphic-formats I need.
With the command-line and Script-language, I can convert / resize any format ( Read : 493 / Write : 64 ) !!!.
Most of them are not supported with < Freeimage.dll >
There is still a Script-editor on my todo-list.
What you can do, just have a look at the textfile at the end of the post.

That means :
1. select the image from the project-database.
2. Open the export-dialog and choose the format and size to convert.
3. Open the Script-browser and choose what to do with the image.

A sample : Convert from JPG to BMP and resize
Code: Select all  Expand view
// Your selected image from the project-database
//-------------------------------------------------------
newFORMAT := c_Path + "\" + ALLTRIM(cSUBDIR) + cIMAGE       

// This is stored in Your script-database
//--------------------------------------------
NCONVERT -out cEXTENSION -resize cWIDTH cHEIGHT newFORMAT

The vars must replaced with real values
----------------------------------------------
newFORMAT := c_Path + "\" + ALLTRIM(cSUBDIR) + cIMAGE       
cNEW := ALLTRIM(cSCRIPT)
cNEW1 := STRTRAN ( cNEW, "cEXTENSION", " " + cEXTENSION + " ")
cNEW2 := STRTRAN ( cNEW1, "cWIDTH", " " + cWIDTH + " " )
cNEW3 := STRTRAN ( cNEW2, "cHEIGHT", " " + cHEIGHT + " " )
cNEW4 := STRTRAN ( cNEW3, "newFORMAT", " " + newFORMAT + " " )
cCONVERT := STRTRAN ( cNEW4, "cNEWFILE", " " + cNEWFILE + " " )

// This runs the script
// -----------------------
WINEXEC ( "&cCONVERT", 0 )



A overwiew :

Any Image, stored in the project-database, You can open directly with xNVIEW.
The path to xNVIEW You have to define only once. It will be stored to a MEM-var.

Image

WMF is not supported with Freeimage.dll !!!
Not supported formats have a red bitmap.
These files you can open with the connected xNVIEW.exe

Image

Changed GIMP to xNVIEW ( much faster and more functions )
Freeware with many languages !!!

Image

Convert / resize to a different format :
There is a SORT-field, to get desired formats on top of the xBrowse.
A empty field < New File > will use the original-name.
TEST.JPG will be stored as TEST.BMP

Image

Image

Code: Select all  Expand view

Usage : nconvert [options] file ...

        Options :
          -quiet            : Quiet mode
          -info             : Display informations only
          -fullinfo         : Display informations & metadata only
          -v[.]             : Verbose
          -in format        : Input format number or -1
          -page num         : Page/image number
          -xall             : Extract all images
          -multi            : Create a multi-page (TIFF/DCX/LDF only)
          -npcd num         : PCD 0:192x128, 1:384x256, 2:768x512 (default)
          -ngrb npic        : HP-48 number of grey : 1, 2 or 4 (default : 1)
          -no#              : # not used for numeric operator
          -clipboard        : Import from clipboard
          -ctype type       : Channel Type (Raw)
              grey  : Greyscale (default)
              rgb   : Red,Green,Blue
              bgr   : Blue,Green,Red
              rgba  : Red,Green,Blue,Alpha
              abgr  : Alpha,Blue,Green,Red
              cmy   : Cyan,Magenta,Yellow
              cmyk  : Cyan,Magenta,Yellow,Black
          -corder order     : Channel Order (Raw)
              inter : Interleaved (default)
              seq   : Sequential
              sep   : Separate
          -size geometry    : Width and height (Raw/YUV)
                Geometry is widthxheight+offset
          -l file : Use file as filelist
          -n start end step : Begin End Step (for image sequence)
          -o filename       : Output filename
              Use # to specify position of numeric enumerator
              Use % to specify source filename
              Use $ to specify source folder
          -out format       : Output format name
          -D                : Delete original picture
          -c value          : Compression number (default : 0)
              PDF    : 1 (Fax), 2 (Rle), 3 (LZW), 4(ZIP), 5 (JPEG)
              TIFF   : 1 (Rle), 2 (LZW), 3 (LZW+Prediction)
                       4 (ZLIB)
                       5 (CCITT G3), 6 (CCITT G3-2D), 7 (CCITT G4) only B/W
                       8 (JPEG) only 24/32 bits
              TARGA, Softimage, SGI, PCX, IFF, BMP : 1 (Rle)
          -q value          : JPEG/PNG/FPX/WIC/PDF quality (default : 100)
          -clevel value     : PNG Compression level (default : 6)
          -i                : Interlaced GIF / Progressive JPEG
          -icc              : Use ICC Profile
          -merge_alpha      : Merge alpha by using 'transparent color' (32bits)
          -transparent value: Transparency index (GIF/PNG)
          -transpcolor red green blue: Transparency color (GIF/PNG)
          -opthuff          : Optimize Huffman Table
          -bgcolor red green blue: Background color (for rotate/canvas)
          -dpi res_dpi      : Set the resolution in DPI
          -keepdocsize      : Resize bitmap function of the old and new DPI value
          -keepfiledate     : Keep original file data/time
          -keepcspace       : Keep original color space if possible
          -jpegtrans op     : JPEG lossless transformations
              rot90  : Rotate 90 degrees
              rot180 : Rotate 180 degrees
              rot270 : Rotate 270 degrees
              exif   : Use orientation EXIF tag
              vflip  : Flip vertical
              hflip  : Flip horizontal
          -jpegcrop x y w h : JPEG lossless crop
          -clean value  : JPEG Clean Metadata (EXIF/IPTC/...)
              1      : Comment
              2      : EXIF
              4      : XMP
              8      : EXIF thumbnail
              16     : IPTC
              32     : ICC Profile
              64     : Other markers
          -rmeta  : Remove Metadata (EXIF/IPTC/...)
          -rexifthumb  : Remove EXIF thumbnail
          -buildexifthumb  : Try to rebuild EXIF thumbnail
          -thumb width height : Extract thumbnail
          -use_cie   : Use CIE Colors (PS/EPS/PDF ghostscript)
          -wflag flag       : Write flag
              os2    : Write OS/2 bmp
              gif87  : Write GIF87a
              hp49   : Write HP49
          -high_res             : Load high resolution (Camera RAW)
          -ascii                : Ascii (PPM)
          -one_strip            : One strip (TIFF)
          -raw_autobalance      : Auto balance (Camera RAW)
          -raw_camerabalance    : Camera balance (Camera RAW)
          -raw_autobright       : Auto brightness (Camera RAW)
          -raw_gamma value      : Gamma (Camera RAW), default=0.6
          -raw_brightness value : Brighness (Camera RAW), default=0.8
          -raw_redscale value   : Red scaling (Camera RAW)
          -raw_bluescale value  : Blue scaling (Camera RAW)
          -ilut file        : Input LUT file (DPX/Cineon)
          -olut file        : Output LUT file (DPX/Cineon)
          -wmfile file      : Watermark file
          -wmpos x y        : Watermark position
          -wmflag flag      : Watermark position
              top-left, top-center, top-right
              center-left, center, center-right
              bottom-left, bottom-center, bottom-right

        Process :
          -32bits           : Convert in 32bits
          -average size     : Average (3,5,7,9,11,13)
          -autocrop tol r g b : Auto Crop
          -balance r g b    : Color balance
          -binary dither    : Convert in Binary
              pattern : Ordered pattern
              floyd   : Floyd steinberg
              halft45 : Halftone 45
              halft90 : Halftone 90
              nodither : No dithering
          -blur percent     : Blur (1...100)
          -brightness value : Modify brightness (-100...100)
          -canvas w h pos   : Resize canvas
              w h can be percent (ex: -resize 100% 200%)
              or #x #y for offset
              pos top-left, top-center, top-right
                  center-left, center, center-right
                  bottom-left, bottom-center, bottom-right
          -conbright value  : Modify brightness (-100...100)
          -colours num
          -colors num       : Convert in Indexed Colors (256, 216, 128, 64, 32, 16 or 8)
          -contrast value   : Modify contrast (-100...100)
          -crop x y w h     : Crop
          -dither           : Use dither for conversion (Colors and Grey only)
          -deinter k n      : De-interlace
              k : even or odd
              n : dup or int
          -edetail          : Enhance detail
          -eedge percent    : Enhance edges (1...100)
          -edgedetect type  : Edge detect
              light/medium/heavy
          -efocus           : Enhance focus
          -emboss           : Emboss
          -embossmore       : Emboss more
          -equalize         : Equalize
          -frestore         : Focus restoration
          -gamma value      : Modify gamma (0.01<->5.0
          -gammasat value   : Modify gamma (0.01<->5.0
          -gauss size       : Blur gaussian (3,5,7,9,11,13)
          -grey num         : Convert in Grey Scale (256, 128, 64, 32, 16, 8 or 4)
          -hls h l s        : Adjust Hue Lightness Saturation
          -lens percent     : Lens (1...100)
          -levels b w       : Levels
          -log              : Apply logarithmic correction
          -maximum size     : Maximum filter (3,5,7,9,11,13)
          -medianb size     : Median Box filter (3,5,7,9,11,13)
          -medianc size     : Median Cross filter (3,5,7,9,11,13)
          -minimum size     : Minimum filter (3,5,7,9,11,13)
          -mosaic size      : Mosaic (1...64)
          -negate           : Negate
          -noise reduce     : Reduce noise
          -noise type value
              uniform   : Add uniform noise
              gaussian  : Add gaussian noise
              laplacian : Add laplacian noise
              poisson   : Add poisson noise
          -normalize        : Normalize
          -oil size         : Oilify (1...16)
          -posterize count  : Posterize (2...256)
          -ratio            : Keep the ratio for scaling
          -rtype            : Type of resampling
              quick    : Quick resize
              linear   : Bi-linear (linear)
              hermite  : Hermite
              gaussian : Gaussian
              bell     : Bell
              bspline  : Bspline
              mitchell : Mitchell
              lanczos  : Lanczos 3
          -rflag            : Flag for resizing
              incr   : Increase only
              decr   : Decrease only
              orient : Follow orientation
          -resize w h      : Scale width-height
              w h can be percent (ex: -resize 100% 200%)
          -rotate_flag      : Rotate flags
              smooth : Use smooth rotate
          -rotate degrees   : Rotate
          -sepia            : Sepia
          -sharpen percent  : Sharpen (1...100)
          -shear            : Shear
          -slice            : Slice
          -soften percent   : Soften (1...100)
          -solarize value   : Solarize (1...255)
          -spread amount    : Spread (1...32)
          -swap type        : Swap component
              rbg   : RGB->RBG
              bgr   : RGB->BGR
              brg   : RGB->BRG
              grb   : RGB->GRB
              gbr   : RGB->GBR
          -swirl degrees    : Swirl (1...360)
          -text string      : Add a text
          -text_font name size  : Font name and size
          -text_color r g b : Text color
          -text_back r g b  : Text background color
          -text_flag pos    : Position of text
              top-left, top-center, top-right
              center-left, center, center-right
              bottom-left, bottom-center, bottom-right
          -text_pos x y     : Position or offset
          -text_rotation degrees : Rotation
          -tile size        : Tile (1...64)
          -truecolors
          -truecolours      : Convert in True Colors
          -xflip            : Flip horizontal
          -yflip            : Flip vertical
          -waves wavelength phase amount : Waves
              wavelength   : (1.0 50.0)
              phase        : (0.0 360.0)
              amount       : (0.0 100.0)



All Plugins must be in a directory called "Plugins" in the XnView directory !

Informations about XnView Plugins (windows only) :
=================================
* Xawd.dll : Allows to read AWD files
* Xbmf.dll + BMF_read.dll : Allows to read BMF files.
* Xdjvu.dll : Allows to read to read AT&Ts DjVu format.
* Xecw.dll + NCScnet.dll + NCSEcw.dll + NCSEcwC.dll + NCSUtil.dll :
Allows to read ermapper format.
* Xeri.dll : Allows to read ERIchan format.
* Xfif.dll + deco_32.dll : Allows to read Iterated Systems format.
* Xfpx.dll : Allows to read/write FlashPix files.
* Xjbig.dll : Allows to read/write "Joint Bi-level Image experts Group" format.
* Xsff.dll : Allows to read Structured Fax files.
* Xwic.dll : Allows to read/write J Wavelet Image Codec format.
* lwf.dll : Allows to read/write Lurawave format.
Can only save images up to 4096x4096 pixels.
* ldf.dll : Allows to read LuraDocument format.
Can only save images up to 4096x4096 pixels and maximum of 6 pages.
* lwf_jp2.dll : Allows to read/write JPEG-2000 JP2/JPC File Format
Can only save images up to 4096x4096 pixels.
* Xiwc.dll : Allows to read/write WaveL format.
* Xjp2.dll : Allows to read/write JPEG-2000 JP2 File Format
& JPEG-2000 Code Stream.
* XMrSid.dll : Allows to read MrSid format.
* Xwlm.dll : Allows to read/write CompW format.
* Xjng.dll + libmng.dll : Allows to read JNG/MNG format.
* Xjpegls.dll : Allows to read JPEG lossless format.
* Xsusie.dll : Allows to use Susie's plugins.
* Xpwc.dll : Allows to read PWC (Fast Piecewise-constant) format.
* Xwhypic.dll : Allows to read YPC format.
* Xp2.dll : Allows to read Pic2 format.
* ncc.dll : Allows to show nCC (net.CynerCards) information from JPG, GIF & PNG files. http://www.netcybercards.com
* mpeg.ll : Allows to extract frame from MPEG1 files
* pcdlib32.dll : Allows to read high resolution of PCD files
* dc120.dll : Allows to read kdc format.
* cpa.dll : Allows to read CPA Prism format.
* Xbsb.dll : Allows to read BSB/KAP format.
* ldf_jpm.dll : Allows to read/write LDF.jpm format.
* CS_DXF.dll + CS_DWG.dll + CS_HPGL.dll + CS_CGM.dll +
S_SVG.dll : Allows to read DXF/DWG/HPGL/CGM/SVG format shareware)
Use third party component from www.cadsofttools.com
* Xcompound.dll : Allows to read 3DSMax & Picture IT! thumbnail, and Microsoft Image Composer.
* Xpax.dll : Allows to read PAX format
* rwz_sdk.dll : Allows to rawzor compressed files

Regards
Uwe :lol:
Last edited by ukoenig on Tue Nov 25, 2008 2:00 am, edited 2 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Download

Postby ukoenig » Mon Nov 24, 2008 1:34 pm

Hello,

I'm still busy with the Scripting-language like :
**********************************
Convert Format X to Y and Resize
---------------------------------------
NCONVERT -out cEXTENSION -resize cWidth cHeight newFORMAT
*****************************************************
New Scrips can shown in the forum and added to the application
More will follow.

I prepared the new release for download :

The Main-application ( 0.8 MB )
http://www.pflegeplus.com/fw_downloads/Imageview3.zip

The Graphic-Runs => Freeimage.dll and nConvert.exe ( 1.5 MB )
copy to Main-application-directory
http://www.pflegeplus.com/fw_downloads/GraphicRuns.zip

The Test-Images ( 3.5 MB ) to Subdirectory : /Image
http://www.pflegeplus.com/fw_downloads/TestImages.zip

The Main-Dialog with Folder
Image

The Folder-Pages :
Write Format ( over 60 formats ) select the format You need for Export.
Image

The Script-Editor to export images
Image

Informations about <Read Formats >( over 650 Formats )
Image

Download xNVIEW or connect directly to the nCONVERT-Forum
( xNVIEW must included to the Application )
Help-buttons for the Scripting-language and how to use.
Image

The Vars You can use inside Your Scripts
Image

nConvert-Forum-Screenshot
You can join the forum for scripting-questions.
Image

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

New Release

Postby ukoenig » Wed Nov 26, 2008 11:33 am

Hello,

Today i put the new release in the forum for download.
Many new things are added.
I still have to add a ERRORHANDLER for the Scripting.

A new Batch-Editor ( Scripts and Batches are possible now ).
The batches are saved in a memo-field. From the Memo, the Batch-file
is created if needed for any Image-filters.
The Batches can include any Commands like : Resize all Images in Directory AB to Directory XY.
There is a new display-option ( Script - Preview ) to test, how the script looks with real values.

Image

Some funny Script-tests :

A JPG converted and resized to GREY
Script : NCONVERT -o OUTPUT.jpg -grey 256 -out cEXTENSION cFILENAME

Image

Maybe you want to convert a image to PNG ?. No problem.
NCONVERT -colors 256 -transpcolor 0 0 0 -o %_256.png cFILENAME

A Screenshot Resized and turned to 45°.
A Batch-file ( The 1. Line ):
### -truecolors -rotate 45 -text_font Lucida 14 -text_color 255 200 100 -text "Hello World" -rtype lanczos -resize 20% 20% -out bmp
resize.bmp
D:\T_IMAGE\Temp1.bmp
D:\T_IMAGE\Temp2.bmp
E:\foto\w0001.png
### -truecolors -resize 300% 300% -out bmp
C:\web\a.gif
C:\web\b.gif
C:\web\c.gif

Image

Resize and convert to a different format
Script : NCONVERT -out cEXTENSION -resize cWIDTH cHEIGHT cFILENAME

Image

Normal scripts are easy to write.
The input-format is automaticly detected.
cEXTENSION = new Format
cWIDHT = new Width
cHEIGHT = new Height
cFILENAME = the selected Image to convert

With Batch-files, much more is possible :
You can use FOR / NEXT, .... ( Visual-Basic-Syntax )

REGARDS
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 82 guests