-
Notifications
You must be signed in to change notification settings - Fork 5
graphics and image processing Notes
- Recording terminal screencasts
- Working with digital cameras
- Working with Inkscape
- Gimp
- ImageMagick
- Working with 3D
- 3D Printing
- UsefulLinks
- TODOs
asciienma is a popular CLI utility for recording terminal based screencasts which becomes quite handy when describing and demoing different terminal based applications.
To record an ASCII screencast that can be later uploaded to asciinema.org
asciinema rec -i=2 /path/to/store/cast/file.json
To stop the recording
control + d
To playback the newly recorded asciicast / screencast recorded with asciinema
asciinema play /path/to/recorded/movie.cast
To convert the above recording to animated GIF, which useful when opening a GitHub issue, and you don't want to link to an external site, but rather show the usage behavior in the current issue page internally on GitHub.
cd /opt/docker
echo "must cd into a directory that is bind mounted within the docker settings"
docker run --rm -v $PWD:/data asciinema/asciicast2gif:latest -s 2 recording.cast file.gif
βοΈβοΈβοΈ November 4, 2019
asciicast2gif has serious issues if trying to convert a cast file with several hundred frames, ie. ~ a cast larger than a minute or so, that said there is a updated command to allow asciicast2gif handle the larger file sizes.
- π‘ ran into issues with specifying a fully qualified path to the
.cast/.json
file, so for time being copy file into same directory, ie./opt/docker
for ease of use
cd /opt/docker
echo "cmd for working with large cast files"
docker run --rm \
-e "GIFSICLE_OPTS=--lossy=80" \
-e "NODE_OPTS=-max-old-space-size=12288" \
-e "MAGICK_MEMORY_LIMIT=6gb" \
-e "MAGICK_MAP_LIMIT=12gb" \
-v $PWD:/data asciinema/asciicast2gif -s 2 input.{cast,json} output.gif

Much thanks goes this comment on the issue tracker for asciicast2gif
βοΈ The docker container running the process of converting the asciicast to a GIF will not be able to access files outside a shared directory / volume docker has read/write access to. For my particular use case I have /opt/docker
directory that can be bind mounted within a docker container, so the container and read and write files on the host system.
The above GIF conversion command relies on some form of a docker daemon being accessible from the working computer.
If the animated GIF requires further editing then GIMP is a suitable solution for editing the individual frames of a GIF file.
A couple quick notes about editing a GIF in GIMP, when scrubbing the GIF playback using external Animation filter, d is used to step back a frame, and f is used to step forward a frame. Also, to crudely playback an animation within GIMP itself, I set a custom keyboard shortcut of v to toggle the visibility of a layer, which can be used with the arrow keys to pseudo play animation in GIMP. This is useful when deleting excess frames to make a terminal GIF cast more terse because the layer names will not correspond to the animation playback frames, which becomes annoying when trying to selectively delete erroneous frames / layers from an animated GIF.
The iPhone 6 includes a 8 megapixel camera on the back side of the phone. When the phone is held in the vertical position it takes a picture with a aspect ratio of 3 : 4 with ~ 2448 pixels wide by 3246 pixels high.
To display metadata for a particular image
identify /path/to/file.jpg
To remove all metadata from a raster image
exiftool -all= -overwrite_original /path/to/file.jpg
Working with Inkscape π
Newer version of Inkscape provide a setting within the document properties to the document to the size of a rectangular outline of the largest object within the document.
File > Document Properties...
To crop the content of object / layer of that of another object within the same layer use,
Object -> Clip -> Set
Make sure the object / layer to be clipped is selected 2nd
The easiest way I know to send the selected objects to a specific layer in Inkscape is to cut βοΈ the current selection ctrl+x then select the desired layer and paste in the selection.
If text does not appear to render when viewing an svg in a web browser then try the following.
- Select the text from the appropiate layer.
- With the text object selected, Select the Text menu item, then select Convert to Text
GIMP supports custom paths for scripts
Per the GIMP documentation on the gimp.org website, GIMP supports a per user configuration file, ie. a RC file in
$HOME/.gimp-2.[MINOR_VERSION]/gimprc
Ex
$HOME/.gimpr-2.10/gimprc
The GIMP scripts, .scm contained within this dotfiles repo are contained within $HOME/.config/GIMP/2.10/scripts/
writting this down ...finally because I always have to relearn how to do this
To move a guide in GIMP hold down the shift with the mouse cursor over the guide, and when the guide color changes from blue to red, then the guide can be moved using the mouse.
In short when exporting a an xcf to an animated GIF
When exporting .xcf to an animated GIF the GIF file format can work with GIMP layer groups thus merge all layers in a group to a single layer before exporting.
frame 3 (1000ms)
frame 2 (1000ms)
frame 1 (1000ms)
To convert / create a PDF from a sequence of images using ImageMagick
convert 01.jpg 02.jpg 03.jpg 04.png 05.bmp output.pdf
π‘ tip when working with STL files, meshes are tessellated using triangles as opposed to quads.
IMHO a more natural workflow is use perspective view orbiting within a scene, and use orthographic when viewing a scene from top bottom front and sides
To make Blender perform the switch from ortho to perspective automagically
Edit β Preferences β Navigation β Orbit and Pan β
- Auto Perspective
Opening multiple instances of a Blender.app on macOS require launching the blender binary from a CLI. An advantage of launching Blender.app from the blender binary contained within the app bundle is multiple .blend files can be opened simultaneously.
If an edge needs to be constructed to between two vertices where an edge does not exist
- Select both vertices obviously in edit mode
- Press the f key or choose the fill option from a menu
A edge should appear between the two selected vertices, ie. connecting the verts.
- tags #blender #2.80 #key #keybindings #keyboard #shortcut #shortcuts
To quickly display the snapping menu underneath the cursor
shift + control + tab
To move the cursor in Blender to position under the mouse cursor π± within a 3D Viewport
shift + RMB
To cycle between vertex, edge, face selection
1, 2, 3
To repeat the previous selection in a 3D View
shift+r
To toggle x-ray mode in Blender on macOS
alt + z
To toggle the viewport from single view to quad view
control + alt + q
todo insert explanation gif
- make sure the model does not have double / duplicate verticies
- make sure the model does not contain any manifolds
-
tags #stl #export #exporting #3dprinting #3d-print
In order to preserve scale of a model that has been made using Blender a couple of settings need to be adjusted.
βοΈ Most if not all 3D printers work on a mm milimeter measurement / sizing scale.
βοΈ stl files do not conform to a specific unit for model sizes, ie. a stl does not know what a blender unit is.
-
Make certain the Units within the Properties > Scene Editor is set to Metric and the Unit Scale is set to 0.001
-
βοΈ If exporting a single object, ie. only the selected object within a scene the scale of the object may need to be adjusted itslef.
-
When I was modeling a M8 nut the scale of the nut was NOT correct using a Unit Scale of 0.001, however scaling the nut constructed using Bolt Factory 10x dialed the size of the nut for experimenting with 3d printing.
When exporting a model / mesh to an stl file to be opened in Cura set the following export settings
-
-
Scale 1.0
-
βοΈ make certain scene unit is not checked when exporting.
-
Editors in Blender are different types of windows ie. 3D View and File Browser are two different types of editors.
Editors can be split or joined by RMB click on the edge of the editor.
To select an object in Blender, be in Object Mode and LMB the object.
To deselect the currently selected object LMB click on a new object.
To add to a selection LMB while holding shift and, likewise a selected object can be deselected while clicking LMB + shift
Working with rulers in Blender 2.79 is quite limited IMHO, because after a ruler is created the starting and ending point can not be relocated / edited.
To delete a ruler they can be located in the Grease Pencil drop down in the Properties n of the 3D View.
The visibility of Grid Floor can be toggled from within the Properties panel n of the 3D View.
To assign a specific color to an object in Blender to easily distinguish between different objects in a 3D View Editor
- Open a Properties Editor
- Select the Material Type button / graphic
- Create a new material, and adjust color of the material using the sphere.
- Select an object in the scene and then apply the newly created material to the object.
-
TODO add notes about backing up cura settings when upgrading -
see the following link for app directory paths containing files that can and should be backed up between cura upgrades.
βοΈ The below settings are highly opinionated ...you've been warned
- A common retraction setting for cura is 6mm @ 60mm/s
- An optimized retraction setting is 6mm @ 25mm/s thanks
- A suggested setting for rafts are
- air gap 0.2
- top layer thickness 0.12 same as material layer height setting
- middle thickness 0.16
- a nickel coated copper nozzle can reach temperatures required to print poly carbonate based filaments.
To manually install Octoprint see the official octoprint guide
thingiverse > first layer testing
creality3d.cn > Official Homepage
the above link provides files for both the lcd and firmware
- The version of the CR-10s pro I have comes with a v2.4.1 motherboard
The CR 10S Pro has a magic number of 0.04 as most if not all Creality printers have a magic number of 0.04 This number refers to the layer height of a print. The layer height is determined by the stepper motors for the printer and does not refer to the micro stepping of the stepper motors. There is a great video of this magic number correlating to the stepper motors.
βοΈ the info in this section is gunna be, kindof random for the time being, as it's a transcribe of notes I've been making for doing various upgrades to a CR-10S Pro, circa August 2019
- The most common connectors found on the logic board for the CR-10S Pro are JST
- JST connectors come in a variety of pin outs and pin arrangements, however a standard 0.1"22AWG jumper can be connected to any pin out on the logic board.
- To the best of my knowledge the spacing for the various JST connectors on the logic board are 1.25mm
- The 30pin ribbon cable that comes with the printer is ~ 4 feet 3 inches in length and has ten unique colors on the cable that start with brown and end with black.
- A 22AWG jumper wire should supply enough amperage for every current version of a rpi as it can provide a steady 3A in a chassis configuration, ie. under 1ft wire length.
- the 30pin ribbon cable uses what I believe to be a IDC connecter on both ends for termination and it appears the pitch of the pins is ~ 2.54mm ie. 0.1 inch.
the pitch is measured from the center of a pin to the center of a parallel pin.
- TODO uncertain of the AWG for the wire used in the 30pin cable.
- βοΈ MOST if not all electronics powered from the 30pin ribbon cable are polarity dependent, ie. the hot end fan JST connectors must be plugged in a certain way, ie. black wire negative has to be plugged in to the negative output from the logic board.
- clear heat shrink tube / tubing can also be referred to as natural.
- AWG refers to wire pitch / gauge
- purchased soundoriginal 12V blower 5015 fan from amz where the red 28AWG wire is positive and the black is negative.
- Marlin show current layer # of the layer being printed
- Marlin ring bell / speaker when hotend or heat bed gets to set temperature
- Blender add note about preserving scale when exporting stl and importing stl into cura
- Blender make quick little cast / video about different orbiting methods in blender
- review useful links
If you find any of this info helpful on your journey π click that π βοΈ star button. It sure makes me feel warm and fuzzy π» on the inside.
-
Linux and macOS Operation Notes
- β macOS Op Notes
- π§ Linux Op Notes
- Vim & Neovim Notes
- git Notes
- π fish shell Notes
- ECMAScript Tooling
- π₯§ Raspberry Pi Notes
- asdf version manager Notes
- Bind9 Notes
- Creating a custom motd on Debian Jessie
- ECMAScript Tooling
- Email client Notes
- Email Server Setup Notes Postfix & Dovecot
- Emoji side quest
- fish shell Notes
- π₯ π€ git it got it good Notes
- git Notes
- Graphics and Image Processing Notes
- GUI text editor Notes
- π»π§ Homebrew and Linuxbrew formula Notes
- Linux and macOS Administration Notes
- Linux and macOS Troubleshooting Notes
- MacBook Pro Late 2013 Notes
- Vim & Neovim Notes
- Video Production Notes
- Python Notes
- radare Notes
- Raspberry Pi Notes
- Terminal Emulators
- Tmux Notes
- Web Browser Notes
- Weechat Notes
- Microsoft Windows Notes