NYCJUG/2011-02-08/HandlingImagesInJ7

From J Wiki
Jump to: navigation, search

Handling Images in J7

from	 Devon McCormick <devonmcc@gmail.com>
to	 Programming forum <programming@jsoftware.com>
date	 Mon, Jan 31, 2011 at 9:58 PM
subject	 Re: [Jprogramming] Fractals Visualization and J

I think reading and writing images are all I use from image3, so this may be sufficient for my purposes. I'll have to try some conversions to see if this is the case.

On Mon, Jan 31, 2011 at 7:37 PM, bill lam < bbill.lam@gmail.com > wrote:

The verb ''readimg'' in jgtk can read image files, and similar verbs are provided in ''platimg'' on J6. You don't have to use gtkide in order to use the jgtk package.

Since the source code for image3 is not public, I guess it should be updated by its own authors.  Or run it in J6 as suggested.

Пнд, 31 Янв 2011, Charles Turner писал(а):

> On Jan 31, 2011, at 2:35 PM, Devon McCormick wrote:
 >
 > > Any idea how hard  it would be to build gtk equivalents of these basic
 > > functions?  Does this make sense, i.e. would it help cross-platform
 > > portability?
 >
 > The little time I've spent with the code revealed it couldn't just be recompiled for Mac-Intel.
...

---

from	 Ron Jeffries <ronjeffries@acm.org>
date	 Tue, Feb 1, 2011 at 7:02 AM

Hello, Charles. On Tuesday, February 1, 2011, at 4:30:04 AM, you wrote:

 > On Jan 31, 2011, at 7:37 PM, bill lam wrote:
 >> Since the source code for image3 is not public, I guess it should be updated by its own authors.
 > I'm not expert on the GPL, but it's likely J Software is in violation of it for not providing the source to this
 >  library. As I mentioned, the Reiters made the source available to me, but out of courtesy, I'll ask them for
 >  permission to make it more widely available. They don't have the time or resources to continue to support it.

As an experienced individual approaching J for the first time, I've found Reiter's book to be quite tasty. It lets me experience actual and interesting results, in ways that seem to be rather consistent with how J is really used.

As such, I think the book can be a valuable resource for newcomers. To serve that need, however, the examples need to work as shown. I believe it would be a great service if it could be carried forward. As it stands, a noob is pretty much stopped dead when an example doesn't work.

I would help if I could. At the moment I'm too dumb to do much more than whimper.

Thanks,

Ron Jeffries www.XProgramming.com

The central "e" in "Jeffries" is silent ... and invisible.

---

from	 Cliff Reiter <reiterc@lafayette.edu>
date	 Tue, Feb 1, 2011 at 11:15 AM

Hi Charles,

There is no problem with making the source more widely available. I think it does lurk somewhere on a Lafayette server but Jsoftware would be a better place for it.

It is true that I don't have the resources to support continued development and have not spent time with J7.01 so it is not clear to me what the best strategy would be. Core is image read/write and digital camera type movie read/write also desirable. I probably could handle refreshing the J cover functions for html galleries and the like.

Best,

Cliff -- Clifford A. Reiter Lafayette College, Easton, PA 18042 http://webbox.lafayette.edu/~reiterc/

---

from	 David Mitchell to Programming

I could not find a DCRaw library.

I found dcraw.c and compiled it:

 C:\Users\me\Downloads\dcraw>cl dcraw.c /DNO_JPEG /DNO_LCMS /O2b2 /Gry

 Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64
 Copyright (C) Microsoft Corporation.  All rights reserved.

 dcraw.c(360) : warning C4133: 'function' : incompatible types - from 'UshORt *'
 to 'char *'
 dcraw.c(360) : warning C4133: 'function' : incompatible types - from 'UshORt *'
 to 'char *'
 dcraw.c(8607) : warning C4133: 'function' : incompatible types - from 'UshORt *'
  to 'char *'
 dcraw.c(8607) : warning C4133: 'function' : incompatible types - from 'UshORt *'
  to 'char *'
 Microsoft (R) Incremental Linker Version 10.00.30319.01
 Copyright (C) Microsoft Corporation.  All rights reserved.

 /out:dcraw.exe
 dcraw.obj

I put in in my path and ran it from J7:

    f=:'Z:\My Pictures\2011\2011 01 29\_MG_1078.CR2'
    spawn_jtask_ 'dcraw -6 -T -o 3 -w -v "',f,'"'
 Loading Canon EOS DIGITAL REBEL XT image from Z:\My Pictures\2011\2011 01
 29\_MG_1078.CR2 ...
 Scaling with darkness 257, saturation 4095, and
 multipliers 2.351670 1.000000 1.350688 1.001965
 AHD interpolation...
 Converting to WideGamut D65 colorspace...
 Writing data to Z:\My Pictures\2011\2011 01 29\_MG_1078.tiff ...

It seems to work fine this way, but it does not seem to provide general image support, only raw image conversion. ---

from	 Tikkanz <tikkanz@gmail.com>
date	 Tue, Feb 1, 2011 at 2:37 PM

The media/platimg addon (available on J6 but not yet J7) provides native platform support for reading and writing many common image formats (not raw though).

DC can be captalised as it the initials of the continuing author Dave Coffin.

http://en.wikipedia.org/wiki/Dcraw

Where did you get the file from? The definitive (?) place is

http://www.cybercom.net/~dcoffin/dcraw/

It provides no UI, only file IO, as a good unix citizen ... and is therefore supported by all platforms. When it is compiled as available to a platform with a good UI it is perhaps superior to even the various camera manufacturers’ proprietary converters, and certainly more permanent and encompassing.

Computational photography (http://u.tgu.ca/levoy+cam2) can be obtained in J ... with an IO to sources and a UI to the user.

My primary concern now is with the N900 which has a Maemo OS, a Linux type. As the only available Frankencamera (http://u.tgu.ca/Frankencamera_lite) it is a major step for the computational photography community. Is it possible to put J on the N900?

Can DCraw be added in the media/platimg addon ?

greg ~krsnadas.org

---

from	 Charles Turner  to Programming

On Feb 1, 2011, at 11:15 AM, Cliff Reiter wrote:

 > There is no problem with making the source more widely available. I think
 > it does lurk somewhere on a Lafayette server but Jsoftware would be a
 > better place for it.

The image3 dynamic library source tarball is available here:

 <http://vze26m98.net/j-lang/image3-source.tar.gz>
C.

---

from	 bill lam <bbill.lam@gmail.com>
date	 Tue, Feb 1, 2011 at 9:01 PM

platimg addons aims at using native os graphic library, quartz in mac, gdiplus in window, there is no native graphic library for linux, but gtk+ is widely used enough. Also it use cd calls to dll/shared library.

Therefore I don't think platimg is a suitable host for dcraw, but maybe as a new addon. ---

from	 greg heil <gheil.j@gmail.com>
date	 Tue, Feb 1, 2011 at 9:53 PM

Sorry the computational photography link is http://u.tgu.ca/Levoy_cam2

greg ~krsnadas.org

---

from	 Charles Turner <vze26m98@optonline.net>
date	 Wed, Feb 2, 2011 at 6:08 AM

On Feb 1, 2011, at 8:46 PM, bill lam wrote:

 > This makes me think that running image3 on J602 is best alternative for readers of the
 > book.

Except this takes me back to my original point (and interest): the library is only available as a PPC dylib for OSX, and so won't work with j602.

So this leaves Mac users out in the cold.

Charles

---

from	 David Mitchell <davidmitchell@att.net>
date	 Wed, Feb 2, 2011 at 6:29 AM

Yes, I got the source from http://www.cybercom.net/~dcoffin/dcraw/dcraw.c

Here are X64 and X86 versions of DCRAW.EXE . The only changes were to add the windows-specific include and define lines. As usual, no guarantees, etc. I did minimal testing on Win7_64 and WinXP_32.

http://rochesterincolor.com/Documents/dcraw.zip