Jump to content

Is there a way to add thumbnails to g-code after it has been generated? Maybe a batch method?


iguanaman
Go to solution Solved by GregValiant,

Recommended Posts

Posted · Is there a way to add thumbnails to g-code after it has been generated? Maybe a batch method?

I know I can create a thumbnail as a post-processing when creating the g-code but is there a way to add the thumbnail after the g-code has been created?  I have a lot of g-code files I would like to add thumbnails to but don't really want to re-process all of them.

  • Link to post
    Share on other sites

    Posted · Is there a way to add thumbnails to g-code after it has been generated? Maybe a batch method?

    Are you talking about a ufp file?  I don't think it's possible to add a thumbnail to a gcode file.

  • Link to post
    Share on other sites

    Posted · Is there a way to add thumbnails to g-code after it has been generated? Maybe a batch method?

    We must have different definition of "thumbnail".  To me a thumbnail is a small photo associated with a file such that on your computer you can see a small image related to the file.

  • Link to post
    Share on other sites

    Posted · Is there a way to add thumbnails to g-code after it has been generated? Maybe a batch method?

    Same definition.   Typically the thumbnail can be generated when slicing into a gcode file.  That image can then be seen within Octoprint for example to see what the model looks like rather than just text.

  • Link to post
    Share on other sites

    Posted · Is there a way to add thumbnails to g-code after it has been generated? Maybe a batch method?

    gcode files are just text files.  They can't contain images. 

     

    ufp files contain lots of meta information including gcode, thumbnails, and other meta information such as what printer you sliced for, what nozzles are needed, materials, etc.  Maybe you mean ufp files?

     

    I think you must mean ufp files.  You can definitely edit/change the thumbnail in a ufp file.  Octoprint (or I guess printoid?) will display that thumbnail.  Here's how you do it:

     

    rename the ufp file to be ".zip" instead of ".ufp".  If you are on a windows computer it may be hiding the extensions.  Google how to show file extensions on your particular version of windows.

     

    Then double click the zip file and you will see the directory struction.  It's easy to find the thumbnail as there are only a few files in there - replace it with a file of the exact same name that you want to be the new thumbnail.  On windows I think it's best to extract the entire ufp into a directory structure, change the thumbnail, then zip it back up with some utility.  I don't use windows much lately but I think windows will zip up a folder if you right click on it?  Or you can install winzip or other app that makes zip files.

     

    Finally rename the .zip extension back to .ufp.  Now octoprint will show the thumbnail.

     

    My description may sound complicated but once you've done it a few times, you can change a thumbnail in about 5 seconds.

  • Link to post
    Share on other sites

    Posted · Is there a way to add thumbnails to g-code after it has been generated? Maybe a batch method?

    This is an example of a gcode file created by Cura which contains a thumbnail which is displayed within Octoprint.

      

    CFFFP_SmallPlanter.gcode

  • Link to post
    Share on other sites

    • Solution
    Posted · Is there a way to add thumbnails to g-code after it has been generated? Maybe a batch method?

    "... is there a way to add the thumbnail after the g-code has been created?"

    Not without writing your own program to convert the images to an ascii format that could be pasted or added into the gcode.

    The Cura post processor takes a "snapshot" of the build plate in Cura (by recording all the pixels of the screen??) and translates that mess into text.  You would need some sort of image of the part and the translating software.

  • Link to post
    Share on other sites

    Posted · Is there a way to add thumbnails to g-code after it has been generated? Maybe a batch method?

    Oh!  So there *is* a way to put an image in the gcode comments.  That's a new feature I've never seen before!  I don't know what algorithm they use to convert an image into ascii data like that.  It looks like base64 encoding.  I think the 300 300 is the image size (300 pixels square) and the big number is the number of bytes or maybe characters that follow.  Then it looks like base64 encoding (you can google about it) and there are utilities and web pages that convert files to and from base64 but you also have to add the comments and carriage returns and so on.

  • Link to post
    Share on other sites

    Posted (edited) · Is there a way to add thumbnails to g-code after it has been generated? Maybe a batch method?
    Link to post
    Share on other sites

    Posted · Is there a way to add thumbnails to g-code after it has been generated? Maybe a batch method?

    None of these scripts will be very helpful. They are meant to be run from inside Cura, and it is no small feat to run them standalone. Additionally, there is no easy way to create a thumbnail image if all you have is a gcode file. Inside Cura, you have the 3d model loaded and it is easy to create a view of that 3d model. Outside Cura, how would you make that image that you would include in the gcode in the first place?

  • Link to post
    Share on other sites

    Posted · Is there a way to add thumbnails to g-code after it has been generated? Maybe a batch method?

    This might be what you're looking for?

     

    https://github.com/FabMo/G-Code-Thumbnail

    • Like 1
    Link to post
    Share on other sites

    Posted · Is there a way to add thumbnails to g-code after it has been generated? Maybe a batch method?

    That looked like it might work but throws a lot of errors and never installs. 

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
         
          • Like
        • 20 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
    ×
    ×
    • Create New...