Coder Social home page Coder Social logo

Comments (7)

timholy avatar timholy commented on July 28, 2024

Closing the window is already possible already through the first output, but it's not as easy as it should be. The pull request referenced above would make it much easier.

What do you mean by "update"? The combination of the first and second outputs lets you call several of the functions in ImageView directly, notably resize and redraw. Need something different?

from imageview.jl.

staticfloat avatar staticfloat commented on July 28, 2024

Hey Tim, I'm trying to do the same thing here and don't think I understand the API fully.

I am writing an implementation of Seam Carving for Content-Aware Image Resizing (PDF), and so I want to do things like draw into the same window multiple times, preferably with the ability to output an image of different dimension each time. (Resizing the window frame itself would be nice as well). Can you post an example of the code needed to do that?

from imageview.jl.

timholy avatar timholy commented on July 28, 2024

Thanks for the explanation. Right now redrawing with an image of different dimensions is not supported. This is fixable, of course.

I'm on vacation right now and about to disappear for a multi-day backpacking trip, so now is not the time to push a possibly-breaking change. I'll try to get to this next week.

from imageview.jl.

timholy avatar timholy commented on July 28, 2024

@riegaz, @staticfloat this is done now. Sorry it took so darn long.

Here's a demo:

julia> using ImageView

julia> using TestImages

julia> lh = testimage("lighthouse.png")
RGB Image with:
  data: 3x768x512 Uint8 Array
  properties:
    limits: (0x00,0xff)
    colordim: 1
    spatialorder: ["x","y"]
    colorspace: RGB

julia> mand = testimage("mandrill.tiff")
RGB Image with:
  data: 3x512x512 Uint8 Array
  properties:
    limits: (0x00,0xff)
    colordim: 1
    spatialorder: ["x","y"]
    colorspace: RGB

julia> imgc, img2 = display(lh,pixelspacing=[1,1])
(ImageCanvas,ImageSlice2d: zoom = BoundingBox(0.0,768.0,0.0,512.0))

julia> display(imgc, mand)
(ImageCanvas,ImageSlice2d: zoom = BoundingBox(0.0,512.0,0.0,512.0))

Also, running "test/tile.jl" is fun.

from imageview.jl.

staticfloat avatar staticfloat commented on July 28, 2024

Awesome, thanks @timholy!

from imageview.jl.

timholy avatar timholy commented on July 28, 2024

I went back and re-read the issue, and noticed you folks asked a few more questions. So here are some other tidbits:

  • If you want to "forget" the previous settings when you display a new image in an old ImageCanvas, just say display(canvas(imgc), mand). canvas returns a Tk Canvas object. You can add settings after the image (mand) if you want (e.g., pixelspacing=[2,1]).
  • If you want to close the window: destroy(toplevel(imgc)) (toplevel returns the window)
  • If you want to resize the window: set_size(toplevel(imgc), w, h)

These features require master; I'll update the sha1 soon, but Ron Rock indicated he may also have some new stuff coming, so I'll wait a bit.

from imageview.jl.

rsrock avatar rsrock commented on July 28, 2024

I'm done now, but see the comment on the latest commit...

from imageview.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.