icepam's Forum Posts

  • hi Pode, do you know about this: github.com/manuels/unix-toolbox.js-imagemagick ?

    It would be great if your plugin could do some of the distorts that imagick does, in particular the perspective distort, but instead of passing just the 4 target points and mapping the image corners to them, you pass any 4 original points and 4 targets, which allows you to do all kinds of cool things, such as perspective correction.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • > R0J0hound It looks like your updated Paster do not paste objects anymore

    > On every capx I've checked (using r196) "Paste Object into canvas" do not work at all.

    >

    Indeed, can confirm.

    me too, thought it was me

  • thinking out loud here, would something like this be feasible with the current plugin? it would allow an extra degree of adjustment in the center of the image where the "diagonal" was hurting most. By extrapolation one can write a routine that will subdivide the whole image with such quads, with coordinated nodes... anyone?'''

    [attachment=0:1gt3meqt][/attachment:1gt3meqt]

  • thank you R0J0hound, this looks nifty, and what you did should be sufficient for my demo, until I find a better technology to do this function. I don't understand uv mapping so I will do some research anyway to understand your capx.

    I have done a version which seems to get slightly better results, but it is much more convoluted than the 5 lines in your capx. I will try to share later if anyone is interested.

  • Thanks R0J0hound, I found these maths (add the dots): www imagemagick org/Usage/distorts/#perspective, but as you said the block is the lack of trapezoid to start with.

    Can the plugin have an added action like "copy underlying pixels to the quad" (with custom resolution ideally) - which would be similar to having a quad shaped Paster object I guess?

    Then the 2D maths at imagemagick should, if I understood it correctly, allow us to fix the distortion - no need for z.

  • Thanks for paster and canvas R0J0hound, wonderful plugins.

    I am trying to do a perspective adjustment tool: takes a photo of a building and makes a flattened version of its facade. It is something that you can see in action on the youtube video (look for video # shIplS95nyk, i can't post links yet...), and in the below screengrab.

    I've started laying out something (attached capx) but obviously haven't figured out what to do next... any ideas? Somebody?

    The main problem is the fact that there seems to be no way of having a trapezoidal canvas or paster, so there is no way to capture the original distorted facade before stretching it back to a square...

    [attachment=0:38b8clq0][/attachment:38b8clq0]

    [attachment=1:38b8clq0][/attachment:38b8clq0]

  • yes, it does crash on me every other try. In reality I need half this resolution so it should be ok in practice. My laptop has an Nvidia GEFORCE with 2GB vram.

    thanks again and kudos for SG.

  • hahahaha it works! thank you so much Somebody!

    btw, are you using cranberrygame's amazing SquareBoard/Grid plugin? or something similar for StuffGen?

    [attachment=0:1tmh8ekz][/attachment:1tmh8ekz]

  • Got it to work, but not really as expected.

    I was very happy to see your wonderful StuffGen Somebody - beautiful interface and indeed quite fun to use. I am myself also doing an app, not a game, so was encouraged by how neat yours is. I particularly salute the way you've used paster to export the designs.

    I was wondering if you could help me in figuring out how to do the inverse of what you did, you see you are taking a large canvas and exporting parts of it, generally to same or smaller resolutions, to be used on screen.

    In my app, I need to do the opposite, namely I need to create PNGs that are at a higher resolution than the screen to be printed (hint: am making a kind of paper-art design app).

    I have managed to create larger-than-screen PNGs but the image pasted is just scaled up from the screen resolution without any gain in detail, quite the opposite.

    The original sprites are larger than the pixels they appear on screen at. For example, the object could be 512x512, but would be scaled down on some screens to appear say 128x128px in size. But i needed to be printed at 5x5cm at 200dpi, which is around 400x400px.

    Using the setup in R0J0hound's paster_loadCanvas.capx: a backdrop Paster1 that loads the canvas, then a front Paster2 that pastes Paster1, and exporting Paster2.imgURL, the resulting image is large, but bad.

    Attached are two ways of producing the image, one with the built-in CanvasSnapshot, so same resolution than screen, and the other is with Paster, at custom resolution almost 7x Screen.

    Is it a built-in limitation that loadCanvas is essentially just passing CanvasSnapshot into Paster, at screen resolution?

    [attachment=0:1sl2xqd3][/attachment:1sl2xqd3]

    [attachment=1:1sl2xqd3][/attachment:1sl2xqd3]

  • ha! thank you Somebody (and R0J0hound for making the plugin)! it's producing the file, but it's blank, although I tried to do "Paster>Load texture from canvas" before invoking the imageUrl. I supposed that would copy the entire canvas into the Paster (an equivalent of System>save canvas snapshot, but resolution independent) - is that not the case?

    I will mess around more with it and share the capx if I can't figure it out. If am wrong about what to expect from the Load texture from canvas action, please tell me how it should be used.

    +++

  • Thanks Somebody - I am not sure I understand how Paster then exports itself into a snapshot. While it can load textures from URL or from the entire canvas, it doesn't seem to have any action that extracts its texture back into an URL like Scirra's "System>take snapshot of canvas" action does. Am I missing something?

    As for the idea of sequentially moving the object and taking snaps, it does sound like it could work but would require a server-side script to combine the snaps, and I was hoping to avoid that.

  • There ya go, enjoy

    Snapshot selected area / Clipped Snapshot:

    Demo (click to save snapshot) will be linked here once i have enough rep points

    Capx:

    [attachment=0:1yh1xgfa][/attachment:1yh1xgfa]

  • I just wanting to take a canvas shot of a certain area only - NOT the whole screen and then save that image to later use

    Can't open your file, it's saved as version 195 am on a lower version... but here's how i did it for my game:

    Say the area you want to clip is placed under object (for example a 9patch with a thin frame) called "Viewfinder".

    Create two global variables, OriginalCanvasW and OrginalCanvasH.

    System>On start of layout:

    set OriginalCanvasW = OriginalWindowWidth

    set OriginalCanvasH = OriginalWindowHeight

    Create two functions "ClipSave", called when you click your save button, and "ClipReset", called when "System>On Canvas Snapshot" is fired.

    ClipSave:

    System>Set Canvas Size to Viewfinder.Width x Viewfinder.Height

    System>Take Snapshot of Canvas

    ClipReset:

    Do what you need to do with the snapshot (for example Browser>Invoke download of CanvasSnapshot with filename "mysnapshot")

    System>Set Canvas Size to OriginalCanvasW x OriginalCanvasH

    Hope this helps

  • Lookup "System>Canvas Snapshot" in the manual.

  • Hello, is there a way to produce a snapshot of the canvas at higher resolution than the screen?

    For example I would like to produce an screenshot from my game that can be printed to A4, but it gets pixelated when creating a snapshot from say a 480x800 mobile phone resolution.

    Any tricks or plugins or work-arounds?

    Thanks