Images: Difference between revisions
(68 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
= Convert a color image to black and white = | = File formats = | ||
[https://youtu.be/WblPwVq9KnU Explaining Image File Formats] (video) | |||
Note we can compress files before we share them/upload to web servers. | |||
= Free images = | |||
https://unsplash.com/ | |||
== StockAI == | |||
https://www.stockai.com/ Free AI-generated stock photos | |||
= Convert a color image to black and white/grayscale = | |||
* https://linux.cn/article-8851-1.html | * https://linux.cn/article-8851-1.html | ||
* https://www.imagemagick.org/script/command-line-options.php#canny | * https://www.imagemagick.org/script/command-line-options.php#canny | ||
Line 7: | Line 18: | ||
convert.im6: unrecognized option `-canny' @ error/convert.c/ConvertImageCommand/1107. | convert.im6: unrecognized option `-canny' @ error/convert.c/ConvertImageCommand/1107. | ||
$ convert -- | $ convert filename.jpg +clone +level-colors gray,white -background black -alpha remove -colorspace Gray canny.jpg | ||
$ convert filename.jpg -monochrome canny.jpg | |||
$ convert filename.jpg -colorspace Gray canny.jpg # Best | |||
</pre> | </pre> | ||
[https://www.imagemagick.org/script/download.php The current imagemagick version] is 7.0.7-15. | [https://www.imagemagick.org/script/download.php The current imagemagick version] is 7.0.7-15. | ||
== GUI == | |||
[https://itsfoss.com/converter-tool/ Convert and Manipulate Images With ‘Converter’ GUI Tool in Linux] | |||
= Free-to-Use Image-Editing Apps for Linux = | |||
[https://www.makeuseof.com/best-free-image-editing-apps-for-linux/ The Top 9 Free-to-Use Image-Editing Apps for Linux] | |||
= Install/build the latest imagemagick = | = Install/build the latest imagemagick = | ||
Line 39: | Line 57: | ||
# install and verify | # install and verify | ||
sudo make install | sudo make install | ||
sudo ldconfig /usr/local/lib | |||
sudo checkinstall | sudo checkinstall | ||
Line 75: | Line 94: | ||
<pre> | <pre> | ||
convert my-image.jpg -colorspace Gray my-image-gray.jpg | convert my-image.jpg -colorspace Gray my-image-gray.jpg | ||
# OR | |||
convert <img_in> -set colorspace Gray -separate -average <img_out> | |||
</pre> | |||
To convert into a 2-bit image | |||
<pre> | |||
convert my-image.jpg -colorspace Gray -depth 2 my-image-gray.jpg | |||
</pre> | </pre> | ||
= Create sprite/pixel art = | |||
* [https://www.piskelapp.com/p/create/sprite Piskel] | |||
* [https://www.pixilart.com/draw Pixilart] | |||
= Convert an image to a different resolution/pixel size = | |||
[https://medium.com/@contactsunny/a-few-basic-but-powerful-imagemagick-commands-b5809b0a1076 A few basic (but powerful) ImageMagick commands] | |||
<pre> | |||
convert image.jpg -resize 1024x768\! output_file.jpg | |||
</pre> | |||
== Anti-alias 修邊 == | |||
* The prefix “anti-” in “antialiasing” means “against” or “opposite of”. So, “antialiasing” refers to the technique that is used to counter or prevent the effect of aliasing. '''Aliasing is a problem that causes different signals to become indistinguishable (or aliases of one another) when sampled. It often occurs in computer graphics when representing a high-resolution signal at a lower resolution. ''' Anti-aliasing serves a simple purpose — fixing these jagged edges that show up in games and other computer graphics. | |||
* [https://www.howtogeek.com/73704/what-is-anti-aliasing-and-how-does-it-affect-my-photos-and-images/ What Is Anti-Aliasing, and How Does It Affect My Photos and Images?] | |||
* [https://stackoverflow.com/questions/6023179/anti-aliasing-in-r-graphics-under-windows-as-per-mac Anti-aliasing in R graphics under Windows (as per Mac)] | |||
* [https://www.geeksforgeeks.org/antialiasing/# What is Anti-aliasing?] | |||
** Methods of Anti-Aliasing (AA) | |||
** Types of Anti-Aliasing | |||
** Applications of Anti-Aliasing Techniques | |||
* How to turn on anti-aliasing in games. [https://www.digitaltrends.com/computing/what-is-anti-aliasing/ What is anti-aliasing? MSAA, FXAA, TAA, and more explained] | |||
== Upscayl: AI Image Upscaler == | |||
https://www.upscayl.org/ Upscayl helps you turn low resolution images into high resolution. Crisp and sharp! No internet required. 5+ Modes. Fully Customizable. Free and Open Source. | |||
= Convert an image file to a different format (eg icon) = | = Convert an image file to a different format (eg icon) = | ||
Using the [http://www.imagemagick.org/script/index.php imagemagic] program. | <ul> | ||
<li>https://convertio.co/svg-png/ | |||
<li>Using the [http://www.imagemagick.org/script/index.php imagemagic] program. | |||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> | ||
convert winamp-ncrow.png -resize 32x32 winamp-ncrow.ico | convert winamp-ncrow.png -resize 32x32 winamp-ncrow.ico | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<li>[http://www.tecmint.com/linux-image-conversion-tools/ 4 Ways to Batch Convert Your PNG to JPG and Vice-Versa] | |||
</ul> | |||
== Make an icon using GIMP == | |||
[https://www.howtogeek.com/65291/how-to-make-your-own-custom-windows-7-icons-out-of-any-image/ How to Make an Icon for Windows 10 or 11 Out of Any Image] | |||
[ | = Crop an image = | ||
* [https://www.howtogeek.com/787941/how-to-crop-an-image-into-a-shape-in-google-slides/ How to Crop an Image Into a Shape in Google Slides] | |||
* [http://gradientdescending.com/how-to-crop-an-image-to-a-circle-in-r-with-cropcircles/ How to crop an image to a circle in R with {cropcircles}] | |||
= Rotate an image = | = Rotate an image = | ||
Line 116: | Line 173: | ||
convert -delay 200 -loop 0 file_1.png file_2.png file_3.png animated.gif | convert -delay 200 -loop 0 file_1.png file_2.png file_3.png animated.gif | ||
</syntaxhighlight> | </syntaxhighlight> | ||
= Combine/merge images = | |||
<ul> | |||
<li>Combine 3 images into one row | |||
<syntaxhighlight lang='sh'> | |||
convert image1.png image2.png image3.png +append output.png | |||
</syntaxhighlight> | |||
<li>Combine 3 images into a 2x2 layout | |||
<syntaxhighlight lang='sh'> | |||
# Step 1 | |||
convert image1.png image2.png +append row1.png | |||
convert image3.png null: +append row2.png | |||
# Step 2 | |||
convert row1.png row2.png -append output.png | |||
</syntaxhighlight> | |||
The null: is used to create an empty space for the missing fourth image. | |||
</ul> | |||
= Creating a GIF from images/videos = | |||
[https://lifehacker.com/tech/the-best-ways-to-make-your-own-gifs The Best Ways to Make Your Own GIFs] | |||
= Create a video from images = | |||
<ul> | |||
<li>ffmpeg | |||
<syntaxhighlight lang='sh'> | |||
# frame rate of 24 frames per second, using the libx264 (h264) codec | |||
ffmpeg -framerate 24 -pattern_type glob -i '*.jpg' -c:v libx264 output.mp4 | |||
</syntaxhighlight> | |||
<li>ImageMagick | |||
<syntaxhighlight lang='sh'> | |||
# The -delay option specifies the delay (50/100 = 0.5 seconds) between each frame, | |||
# This means that the frame rate will be 1/0.5=2. | |||
# and -loop 0 makes the video loop indefinitely. | |||
# the default codec used for MP4 output is libx264 | |||
convert -delay 50 -loop 0 *.jpg output.mp4 | |||
</syntaxhighlight> | |||
<li>av | |||
<syntaxhighlight lang='sh'> | |||
# frame rate of 2 frames per second, using the libx264 (h264) codec | |||
av -r 2 -i *.jpg -c:v libx264 output.mp4 | |||
</syntaxhighlight> | |||
<li>Mencoder | |||
<syntaxhighlight lang='sh'> | |||
# frame rate of 2 frames per second, using the MPEG-4 video codec (older than h264) | |||
mencoder "mf://*.jpg" -mf fps=2 -o output.mp4 -ovc lavc -lavcopts vcodec=mpeg4 | |||
</syntaxhighlight> | |||
</ul> | |||
= Convert Video to GIF = | = Convert Video to GIF = | ||
[https://www.makeuseof.com/tag/convert-video-to-gif/ The Best Ways to Convert Video to GIF] | [https://www.makeuseof.com/tag/convert-video-to-gif/ The Best Ways to Convert Video to GIF] | ||
= Edit gif file = | = View images as Slideshow = | ||
* [[Ubuntu#Image_viewer_on_command_line|Image viewer]] | |||
* [https://www.howtogeek.com/i-turned-a-raspberry-pi-into-a-private-slideshow-machine-heres-how/ I Turned a Raspberry Pi into a Private Slideshow Machine, Here's How] | |||
= HDR/High Dynamic Range = | |||
[https://www.makeuseof.com/tag/fake-high-dynamic-range-photos-photoshop/ How to Create Fake High Dynamic Range Photos in Photoshop] | |||
= R packages = | |||
* [https://dahtah.github.io/imager/imager.html imager]: an R package for image processing, [https://cran.r-project.org/web/packages/imager/index.html CRAN] | |||
* [https://www.markhw.com/blog/filmcolorkmeans Color-Swapping Film Palettes in R with imager, ggplot2, and kmeans] | |||
* [https://nrennie.rbind.io/blog/creating-typewriter-images-r/ Creating typewriter-styled images in R] | |||
== Annotate jpeg/png file == | |||
See [[Heatmap#rasterImage|graphics::rasterImage()]] | |||
== Edit gif file == | |||
[https://www.maketecheasier.com/create-gifs-command-tool-ubuntu/ gifsicle] package | [https://www.maketecheasier.com/create-gifs-command-tool-ubuntu/ gifsicle] package | ||
= Replace transparency in PNG images with white background = | = Background = | ||
== Change white to transparent background == | |||
[https://stackoverflow.com/a/11115408 Set transparent background using ImageMagick and commandline prompt] (it works) | |||
<pre> | |||
convert test.png -transparent white transparent.png | |||
</pre> | |||
== Replace transparency in PNG images with white background == | |||
http://stackoverflow.com/questions/2322750/replace-transparency-in-png-images-with-white-background | http://stackoverflow.com/questions/2322750/replace-transparency-in-png-images-with-white-background | ||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> | ||
convert image.png -background white -alpha remove white.png | convert image.png -background white -alpha remove white.png | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Adobe lightroom == | |||
* [https://www.makeuseof.com/adobe-lightroom-how-to-blur-photo-background/ How to Blur a Photo Background in Adobe Lightroom] | |||
* [https://www.linuxlinks.com/best-free-open-source-alternatives-adobe-lightroom-classic/ Best Free and Open Source Alternatives to Adobe Lightroom Classic] | |||
== Online tools to remove background == | |||
* https://www.magiceraser.io/ | |||
* photoroom.com | |||
== Automatic background removal using R == | |||
[https://forloopsandpiepkicks.wordpress.com/2021/04/09/image-segmentation-in-r-automatic-background-removal-like-in-a-zoom-conference/ Image segmentation in R: Automatic background removal like in a Zoom conference] | |||
= Remove unwanted objects = | |||
* https://cleanupphotos.com/. | |||
** Download a video frame from YT. Open GIMP - New. Accept the default image size. Ctrl + v to paste the image from the clipboard. Choose "Image" -> "Crop to Content". Export to PNG. | |||
** I uploaded a png file. The saved file cannot be opened (Fatal error reading PNG image file: Not a PNG file). After I manually changed the extension to jpg and it works. The resolution of the saved image file is decreased however. | |||
* [https://github.com/Sanster/lama-cleaner Lama Cleaner] - A free and open-source inpainting tool powered by SOTA AI model | |||
* [https://youtu.be/Anvr8tR3shM 切勿错过!终于在GitHub上找到10个超强悍的开源软件和免费项目!] | 零度解说. Lama Cleaner, Misskey, StockAI, NBlog, AutoCut, Pake, Fyrox, Tooll 3, SMSBoom, Flarum. | |||
= Remove GPS metadata from jpg files - [http://www.sno.phy.queensu.ca/~phil/exiftool/ exiftool] = | = Remove GPS metadata from jpg files - [http://www.sno.phy.queensu.ca/~phil/exiftool/ exiftool] = | ||
Line 136: | Line 283: | ||
The image file will be updated. To check the current metadata, use | The image file will be updated. To check the current metadata, use | ||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> | ||
exiftool image.jpg | exiftool image.jpg | grep GPS | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 148: | Line 295: | ||
An R package [https://cran.r-project.org/web/packages/exifr/ exifr] also available on CRAN. | An R package [https://cran.r-project.org/web/packages/exifr/ exifr] also available on CRAN. | ||
= Edit Svg image = | = Overlay the date and time onto an image = | ||
<syntaxhighlight lang='bash'> | |||
convert image.jpg -gravity SouthEast -pointsize 24 -fill orange \ | |||
-annotate +10+10 "%[exif:DateTimeOriginal]" output.jpg | |||
</syntaxhighlight> | |||
Note that if output.jpg is replaced with image.jpg, then image.jpg will be overwritten. | |||
<pre> | |||
for img in *.jpg; do | |||
convert "$img" -gravity SouthEast -pointsize 24 -fill yellow -annotate +10+10 "%[exif:DateTimeOriginal]" "$img" | |||
done | |||
</pre> | |||
= Inkscape = | |||
<ul> | |||
<li>https://inkscape.org/ | |||
<li>[https://wiki.inkscape.org/wiki/index.php/Using_the_Command_Line Using the Command Line] | |||
<pre> | |||
inkscape --export-type=png --export-filename=output.png my_file.svg | |||
inkscape --export-type=png --export-filename=- my_file.svg | convert - filename.jpg | |||
</pre> | |||
</ul> | |||
== Error: Failed to get connection == | |||
<pre> | |||
inkscape -C --export-type=png input.svg --export-filename=output.png | |||
# OR | |||
inkscape -C input.svg --export-filename=output.png | |||
</pre> | |||
I got an error when I tested on headless system https://bugs.launchpad.net/inkscape/+bug/1460797. Either command works, however, in a desktop system. | |||
So inkscape in a headless system is not possible! | |||
== Edit Svg image == | |||
* [https://inkscape.org/en/ Inkscape] | * [https://inkscape.org/en/ Inkscape] | ||
* Inkscape from [https://fedoramagazine.org/ Fedora magazine] | * Inkscape from [https://fedoramagazine.org/ Fedora magazine] | ||
Line 154: | Line 334: | ||
** [https://fedoramagazine.org/inkscape-adding-colour/ Inkscape: Adding some colour] | ** [https://fedoramagazine.org/inkscape-adding-colour/ Inkscape: Adding some colour] | ||
** [https://fedoramagazine.org/inkscape-design-imagination/ Create a simple wallpaper with Fedora and Inkscape] | ** [https://fedoramagazine.org/inkscape-design-imagination/ Create a simple wallpaper with Fedora and Inkscape] | ||
* [https://www.youtube.com/channel/UCEQXp_fcqwPcqrzNtWJ1w9w Logos By Nick] (Youtube) | |||
== Stitch == | |||
[https://fedoramagazine.org/make-more-with-inkscape-ink-stitch/ MAKE MORE with Inkscape – Ink/Stitch] | |||
= Animated gif = | = Animated gif = | ||
Line 159: | Line 343: | ||
* [http://superuser.com/questions/558790/how-do-i-convert-gif-to-png-this-image-to-get-the-original-view convert (.gif to .png) this image to get the original view?] (ImageMagick) | * [http://superuser.com/questions/558790/how-do-i-convert-gif-to-png-this-image-to-get-the-original-view convert (.gif to .png) this image to get the original view?] (ImageMagick) | ||
= Display images in the | = Hue/saturation = | ||
[https://www.ostechnix.com/how-to-display-images-in-the-terminal/ Using FIM] | * [https://expertphotography.com/color-saturation/ What is Color Saturation? (How to Understand and Use It)]. You can define saturation as the depth or intensity of color present in an image. | ||
* [https://www.makeuseof.com/how-to-use-hue-saturation-adjustments-photoshop/ How to Creatively Use Hue/Saturation Adjustments in Photoshop] | |||
* [https://drawpaintacademy.com/color-saturation/ Color Saturation – The Ultimate Guide for Artists] with examples. | |||
* [http://www.simplearttips.com/simplearttips/20?rq=color%20theory Understand The Basics Of Color Theory] | |||
* [https://medium.com/the-coffeelicious/a-photographers-guide-to-vibrance-and-saturation-and-their-differences-4fde529cc19 A Photographer’s Guide to Vibrance and Saturation (and their differences)]. Avoiding over-saturation, and Vibrance tool | |||
= Photoshop alternatives = | |||
* [https://www.photopea.com/ Photopea]: | |||
** You can use the free version w/o creating an account. | |||
** Even the app is online but the processing takes place locally. [https://www.youtube.com/watch?v=w1iAatWudkk&t=743 Online Photoshop Alternatives: Which is Best?] | |||
= What’s the Difference between Illustrator and Photoshop = | |||
[https://www.howtogeek.com/708590/whats-the-difference-between-illustrator-and-photoshop/ What’s the Difference between Illustrator and Photoshop?] | |||
= Adobe InDesign vs. Illustrator = | |||
[https://www.makeuseof.com/adobe-indesign-vs-illustrator/ Adobe InDesign vs. Illustrator: Which One Should You Use?] | |||
= Display images in a terminal = | |||
<ul> | |||
<li>[https://github.com/stefanhaustein/TerminalImageViewer tiv]/Terminal Image Viewer contains a mall C++ program. It works when I tested on a Ubuntu 22.04 box. I am using the commit version 7573de8 12/6/2023. | |||
<syntaxhighlight lang='sh'> | |||
git clone https://github.com/stefanhaustein/TerminalImageViewer.git | |||
g++ --version | |||
cd TerminalImageViewer/src | |||
make | |||
sudo make install | |||
tiv myimage.png | |||
</syntaxhighlight> | |||
[[File:Tiv-demo.png|200px]] | |||
[https://github.com/stefanhaustein/TerminalImageViewer/issues/28 File format is not rcognized]. '''sudo apt install imagemagick''' solves the issue. | |||
<li>[https://www.ostechnix.com/how-to-display-images-in-the-terminal/ Using FIM] | |||
</ul> | |||
= Design = | |||
* [https://www.howtogeek.com/679988/how-to-use-canva-to-design-like-a-professional/ How to Use Canva to Design Like a Professional] | |||
* [https://www.pcworld.com/article/2177265/canva-the-best-5-tips-tricks-for-beginners.html Canva: The best 5 tips & tricks for beginners] | |||
== Logos == | |||
[https://www.makeuseof.com/best-websites-create-a-logo-business/ The 4 Best Websites to Create a Logo for Your Business] | |||
== Collage == | |||
* [https://itsfoss.com/photocollage-linux/ Easily Make Collages in Linux With PhotoCollage and Mountain Tapir Apps] | |||
* [https://github.com/adrienverge/PhotoCollage PhotoCollage] | |||
= Recognize a doodling = | |||
* quickdraw.withgoogle.com | |||
* scribblediffusion.com | |||
= OCR = | |||
* [https://www.cloudsavvyit.com/8151/how-to-convert-images-to-text-on-the-linux-command-line-with-ocr/ How To Convert Images To Text On The Linux Command Line With OCR] | |||
* [https://itsfoss.com/gimagereader-ocr/ Use gImageReader to Extract Text From Images and PDFs on Linux] | |||
* [https://www.cisdem.com/resource/best-chinese-ocr-software.html 6 Best Chinese OCR App to Recognize Chinese Characters (Online Incl.)] '''Google Drive''' can do it too (not perfect from my testing). | |||
* [https://youtu.be/sAACv-QqXSU TextSnatcher - Amazoin, OPen Source, OCR for you Linux Desktop!] , [https://github.com/RajSolai/TextSnatcher Github] | |||
= iOS = | |||
[https://www.rd.com/article/how-to-edit-photos-on-iphone/ How to Edit Photos on Your iPhone Using the Photos App]: crop, change the aspect ratio of a photo, rotate a photo, make a mirror image of a photo, select frames from Live Photos, change a photo’s filter, Change the exposure, Adjust the brilliance, Adjust highlights, Adjust shadows, Create contrast, Brighten the photo, Enhance the colors (Adjust saturation, Adjust vibrancy) |
Latest revision as of 20:25, 8 September 2024
File formats
Explaining Image File Formats (video)
Note we can compress files before we share them/upload to web servers.
Free images
StockAI
https://www.stockai.com/ Free AI-generated stock photos
Convert a color image to black and white/grayscale
- https://linux.cn/article-8851-1.html
- https://www.imagemagick.org/script/command-line-options.php#canny
$ convert filename.jpg -canny 0x1 -negate canny.jpg convert.im6: unrecognized option `-canny' @ error/convert.c/ConvertImageCommand/1107. $ convert filename.jpg +clone +level-colors gray,white -background black -alpha remove -colorspace Gray canny.jpg $ convert filename.jpg -monochrome canny.jpg $ convert filename.jpg -colorspace Gray canny.jpg # Best
The current imagemagick version is 7.0.7-15.
GUI
Convert and Manipulate Images With ‘Converter’ GUI Tool in Linux
Free-to-Use Image-Editing Apps for Linux
The Top 9 Free-to-Use Image-Editing Apps for Linux
Install/build the latest imagemagick
- https://www.imagemagick.org/script/install-source.php
- https://gist.github.com/makenova/78bb63aaa1050e2ad8019ee1e7e7b433
- https://www.tutorialspoint.com/articles/how-to-install-imagemagick-on-ubuntu
# remove version installed with apt-get sudo apt-get remove imagemagick && sudo apt-get autoremove # install dependencies sudo apt-get install build-essential sudo apt-get build-dep imagemagick -y # download ImageMagick source wget http://www.imagemagick.org/download/ImageMagick.tar.gz tar xzvf ImageMagick.tar.gz # build source cd ImageMagick-* ./configure make # install and verify sudo make install sudo ldconfig /usr/local/lib sudo checkinstall ********************************************************************** Done. The new package has been installed and saved to /home/XXX/Downloads/ImageMagick-7.0.7-15/imagemagick-7.0.7_15-1_amd64.deb You can remove it from your system anytime using: dpkg -r imagemagick-7.0.7 ********************************************************************** $ convert --version # bash: /usr/bin/convert: No such file or directory $ which convert /usr/local/bin/convert $ whereis convert convert: /usr/local/bin/convert $ /usr/local/bin/convert -version Version: ImageMagick 7.0.7-15 Q16 x86_64 2017-12-20 http://www.imagemagick.org Copyright: © 1999-2018 ImageMagick Studio LLC License: http://www.imagemagick.org/script/license.php Features: Cipher DPC HDRI OpenMP Delegates (built-in): bzlib fontconfig freetype jbig jng jpeg lzma pangocairo png tiff x xml zlib
Convert an image to sketch (online tool)
convert my-image.jpg -colorspace Gray my-image-gray.jpg # OR convert <img_in> -set colorspace Gray -separate -average <img_out>
To convert into a 2-bit image
convert my-image.jpg -colorspace Gray -depth 2 my-image-gray.jpg
Create sprite/pixel art
Convert an image to a different resolution/pixel size
A few basic (but powerful) ImageMagick commands
convert image.jpg -resize 1024x768\! output_file.jpg
Anti-alias 修邊
- The prefix “anti-” in “antialiasing” means “against” or “opposite of”. So, “antialiasing” refers to the technique that is used to counter or prevent the effect of aliasing. Aliasing is a problem that causes different signals to become indistinguishable (or aliases of one another) when sampled. It often occurs in computer graphics when representing a high-resolution signal at a lower resolution. Anti-aliasing serves a simple purpose — fixing these jagged edges that show up in games and other computer graphics.
- What Is Anti-Aliasing, and How Does It Affect My Photos and Images?
- Anti-aliasing in R graphics under Windows (as per Mac)
- What is Anti-aliasing?
- Methods of Anti-Aliasing (AA)
- Types of Anti-Aliasing
- Applications of Anti-Aliasing Techniques
- How to turn on anti-aliasing in games. What is anti-aliasing? MSAA, FXAA, TAA, and more explained
Upscayl: AI Image Upscaler
https://www.upscayl.org/ Upscayl helps you turn low resolution images into high resolution. Crisp and sharp! No internet required. 5+ Modes. Fully Customizable. Free and Open Source.
Convert an image file to a different format (eg icon)
- https://convertio.co/svg-png/
- Using the imagemagic program.
convert winamp-ncrow.png -resize 32x32 winamp-ncrow.ico
- 4 Ways to Batch Convert Your PNG to JPG and Vice-Versa
Make an icon using GIMP
How to Make an Icon for Windows 10 or 11 Out of Any Image
Crop an image
- How to Crop an Image Into a Shape in Google Slides
- How to crop an image to a circle in R with {cropcircles}
Rotate an image
http://www.imagemagick.org/script/command-line-options.php#rotate
convert winamp-ncrow.png -rotate 45 winamp-ncrow2.png # 45 degrees
One problem with this simple approach is the picture size (not image file) changed (become smaller) if the degree is not one of 90,180 or 270.
Create an animated gif file
Use the script here. See the last example on here. The rotation speed looks good too! Just change the source image file in the script.
#!/bin/sh # # Create a rotating figure using Distort SRT transformations # command='convert -delay 10 koala.gif -virtual-pixel white' for i in `seq 5 5 360`; do command="$command \\( -clone 0 -distort SRT $i \\)" done command="$command -delete 0 -loop 0 animate_distort_rot.gif" eval $command chmod 644 animate_distort_rot.gif
Tool to convert a sequence of numbered PNG files to an animated GIF?. Convert command line option. The option '-loop 0' means repeats infinitely and '-delay 200' means 2 seconds delay between each frame.
convert -delay 200 -loop 0 file_1.png file_2.png file_3.png animated.gif
Combine/merge images
- Combine 3 images into one row
convert image1.png image2.png image3.png +append output.png
- Combine 3 images into a 2x2 layout
# Step 1 convert image1.png image2.png +append row1.png convert image3.png null: +append row2.png # Step 2 convert row1.png row2.png -append output.png
The null: is used to create an empty space for the missing fourth image.
Creating a GIF from images/videos
The Best Ways to Make Your Own GIFs
Create a video from images
- ffmpeg
# frame rate of 24 frames per second, using the libx264 (h264) codec ffmpeg -framerate 24 -pattern_type glob -i '*.jpg' -c:v libx264 output.mp4
- ImageMagick
# The -delay option specifies the delay (50/100 = 0.5 seconds) between each frame, # This means that the frame rate will be 1/0.5=2. # and -loop 0 makes the video loop indefinitely. # the default codec used for MP4 output is libx264 convert -delay 50 -loop 0 *.jpg output.mp4
- av
# frame rate of 2 frames per second, using the libx264 (h264) codec av -r 2 -i *.jpg -c:v libx264 output.mp4
- Mencoder
# frame rate of 2 frames per second, using the MPEG-4 video codec (older than h264) mencoder "mf://*.jpg" -mf fps=2 -o output.mp4 -ovc lavc -lavcopts vcodec=mpeg4
Convert Video to GIF
The Best Ways to Convert Video to GIF
View images as Slideshow
HDR/High Dynamic Range
How to Create Fake High Dynamic Range Photos in Photoshop
R packages
- imager: an R package for image processing, CRAN
- Color-Swapping Film Palettes in R with imager, ggplot2, and kmeans
- Creating typewriter-styled images in R
Annotate jpeg/png file
Edit gif file
gifsicle package
Background
Change white to transparent background
Set transparent background using ImageMagick and commandline prompt (it works)
convert test.png -transparent white transparent.png
Replace transparency in PNG images with white background
http://stackoverflow.com/questions/2322750/replace-transparency-in-png-images-with-white-background
convert image.png -background white -alpha remove white.png
Adobe lightroom
- How to Blur a Photo Background in Adobe Lightroom
- Best Free and Open Source Alternatives to Adobe Lightroom Classic
Online tools to remove background
- https://www.magiceraser.io/
- photoroom.com
Automatic background removal using R
Image segmentation in R: Automatic background removal like in a Zoom conference
Remove unwanted objects
- https://cleanupphotos.com/.
- Download a video frame from YT. Open GIMP - New. Accept the default image size. Ctrl + v to paste the image from the clipboard. Choose "Image" -> "Crop to Content". Export to PNG.
- I uploaded a png file. The saved file cannot be opened (Fatal error reading PNG image file: Not a PNG file). After I manually changed the extension to jpg and it works. The resolution of the saved image file is decreased however.
- Lama Cleaner - A free and open-source inpainting tool powered by SOTA AI model
- 切勿错过!终于在GitHub上找到10个超强悍的开源软件和免费项目! | 零度解说. Lama Cleaner, Misskey, StockAI, NBlog, AutoCut, Pake, Fyrox, Tooll 3, SMSBoom, Flarum.
Remove GPS metadata from jpg files - exiftool
sudo apt-get install libimage-exiftool-perl exiftool -gps:all= -xmp:geotag= image.jpg
The image file will be updated. To check the current metadata, use
exiftool image.jpg | grep GPS
Note that the above command only remove gps information. The other information like date/time of creation, camera model are not changed.
Exitftool can also be used to edit the metadata on PDF files.
exiftool -Title="This is the Title" -Author="Happy Man" -Subject="PDF Metadata" drawing.pdf
An R package exifr also available on CRAN.
Overlay the date and time onto an image
convert image.jpg -gravity SouthEast -pointsize 24 -fill orange \ -annotate +10+10 "%[exif:DateTimeOriginal]" output.jpg
Note that if output.jpg is replaced with image.jpg, then image.jpg will be overwritten.
for img in *.jpg; do convert "$img" -gravity SouthEast -pointsize 24 -fill yellow -annotate +10+10 "%[exif:DateTimeOriginal]" "$img" done
Inkscape
- https://inkscape.org/
- Using the Command Line
inkscape --export-type=png --export-filename=output.png my_file.svg inkscape --export-type=png --export-filename=- my_file.svg | convert - filename.jpg
Error: Failed to get connection
inkscape -C --export-type=png input.svg --export-filename=output.png # OR inkscape -C input.svg --export-filename=output.png
I got an error when I tested on headless system https://bugs.launchpad.net/inkscape/+bug/1460797. Either command works, however, in a desktop system.
So inkscape in a headless system is not possible!
Edit Svg image
- Inkscape
- Inkscape from Fedora magazine
- Logos By Nick (Youtube)
Stitch
MAKE MORE with Inkscape – Ink/Stitch
Animated gif
- How to generate a animated GIF or movie out of images on Linux (GIMP or PhotoFilmStrip)
- convert (.gif to .png) this image to get the original view? (ImageMagick)
Hue/saturation
- What is Color Saturation? (How to Understand and Use It). You can define saturation as the depth or intensity of color present in an image.
- How to Creatively Use Hue/Saturation Adjustments in Photoshop
- Color Saturation – The Ultimate Guide for Artists with examples.
- Understand The Basics Of Color Theory
- A Photographer’s Guide to Vibrance and Saturation (and their differences). Avoiding over-saturation, and Vibrance tool
Photoshop alternatives
- Photopea:
- You can use the free version w/o creating an account.
- Even the app is online but the processing takes place locally. Online Photoshop Alternatives: Which is Best?
What’s the Difference between Illustrator and Photoshop
What’s the Difference between Illustrator and Photoshop?
Adobe InDesign vs. Illustrator
Adobe InDesign vs. Illustrator: Which One Should You Use?
Display images in a terminal
- tiv/Terminal Image Viewer contains a mall C++ program. It works when I tested on a Ubuntu 22.04 box. I am using the commit version 7573de8 12/6/2023.
git clone https://github.com/stefanhaustein/TerminalImageViewer.git g++ --version cd TerminalImageViewer/src make sudo make install tiv myimage.png
File format is not rcognized. sudo apt install imagemagick solves the issue.
- Using FIM
Design
Logos
The 4 Best Websites to Create a Logo for Your Business
Collage
Recognize a doodling
- quickdraw.withgoogle.com
- scribblediffusion.com
OCR
- How To Convert Images To Text On The Linux Command Line With OCR
- Use gImageReader to Extract Text From Images and PDFs on Linux
- 6 Best Chinese OCR App to Recognize Chinese Characters (Online Incl.) Google Drive can do it too (not perfect from my testing).
- TextSnatcher - Amazoin, OPen Source, OCR for you Linux Desktop! , Github
iOS
How to Edit Photos on Your iPhone Using the Photos App: crop, change the aspect ratio of a photo, rotate a photo, make a mirror image of a photo, select frames from Live Photos, change a photo’s filter, Change the exposure, Adjust the brilliance, Adjust highlights, Adjust shadows, Create contrast, Brighten the photo, Enhance the colors (Adjust saturation, Adjust vibrancy)