8000 Has issues saving · Issue #107 · libvips/nip2 · GitHub
[go: up one dir, main page]

Skip to content

Has issues saving #107

Open
Open

Description

@Zireael07

Program saves as xml, but only wants to load .ws... Several hours of work went down the drain!

(Yes, I did succeed in making Scharr via convolutions tool, and I was in the process of figuring out how to combine stuff - you know, R channel from image X G from image Y B 0, when I must have clicked something nip didn't like and crashed)

Also: save as never produced a working image file, all of them were all black, even those that were RGB 0-255 according to nips

Activity

  1. jcupitt commented on Apr 1, 2023

    @jcupitt
    Member

    Oh no!

    Try File / Recover -- nip2 saves the last 10 workspace edits in a recovery area, you should be able to get your work back.

    Yes, .ws files are xml inside, but that shouldn't matter. Just save and load to myfile.ws or whatever and it'll all work.

    I'll try assembling your demo images in nip2.

  2. jcupitt commented on Apr 1, 2023

    @jcupitt
    Member

    For a scharr filter in nip2, try saving this file as scahrr.def:

    scharr image
    	= (kx ** 2 + ky ** 2) ** 0.5
    {
    	scharr_matrix = Matrix [
    		[ -3,   0,   3],
    		[-10,   0,  10],
    		[ -3,   0,   3]
    	];
    
    	bw = (float) colour_transform_to Image_type.B_W image;
    	kx = conv scharr_matrix bw;
    	ky = conv (rot90 scharr_matrix) bw;
    }
    

    Start nip2, do Toolkits / Edit, then File / Open and load the .def file. A new toolkit should appear, called "scharr".

    Load an image, then in the main window click Toolkits / scharr and it ought to work. I see:

    image

  3. jcupitt commented on Apr 1, 2023

    @jcupitt
    Member

    I think you saw black because nip2 defaults to integer convolution. Cast your image to float before calling conv and it should work.

    Alternatively you could also redo scharr as an int conv (perhaps add an offset of 128?).

  4. Zireael07 commented on Apr 1, 2023

    @Zireael07
    Author

    Try File / Recover -- nip2 saves the last 10 workspace edits in a recovery area, you should be able to get your work back.

    Thanks, that worked. Attaching my file here so that you can take a look and figure out what is going wrong with save as for images themselves (and I still need a tip on that RGB combining thing - it's trivial in any other library I know but I can't figure it out here)

    nipstest.zip

  5. jcupitt commented on Apr 1, 2023

    @jcupitt
    Member

    In nip2 it's image?band to get a band from an image, and image ++ image to join two images bandwise.

    They work for strings and lists too, so:

    "abc"?1 == "b"
    "ab" ++ "c" == "abc"
    [1..10]?4 == 5
    [10..1]?8 == 2
    [x ** 2 :: x <- [1..]]?100 == 10201
    

    etc etc.

  6. Zireael07 commented on Oct 9, 2024

    @Zireael07
    Author

    Anything on the saving issue (both xml vs ws and the black image)? This effectively renders nip unusable

  7. jcupitt commented on Oct 9, 2024

    @jcupitt
    Member

    I think it works fine, doesn't it?

    Workspace files are XML internally, but that shouldn't matter. Save as fred.ws, load back again, it should all work.

    It shouldn't save black image files, you'll need to give a specific example I can check. What steps exactly did you follow, what format did you save in, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0