1. Summary
I want to apply torn edge effect to my images in ImageMagick. I find bordereffects script, but I can not run it in my Windows.
2. Expected behavior
Like script description.
3. Actual behavior
SashaChernykh#DESKTOP-EEOT0TN /cygdrive/d/Test
$ bordereffects SashaMagic.png Test.png
identify.exe: IncompatibleAPI `./bordereffects_A_1372.mpc' # error/mpc.c/ReadMPCImage/772.
4. Settings
I have file SashaMagic.png in folder D:/Test.
5. Steps to reproduce
I install ImageMagick and Cygwin → I download bordereffects script → I add folder with bordereffects file in my PATH user environment variable → I change convert to magick in bordereffects file → I open Cygwin64 terminal →cd d:Test → I run command bordereffects SashaMagic.png Test.png → I get actual behavior.
6. Environment
Operating system and version:
Windows 10 Enterprise LTSB 64-bit EN
ImageMagick:
ImageMagick 7.0.4-3 Q16 x64 2017-01-07
cyg-get:
1.2.1
Related
I tried installing imagemagick using homebrew on a Mac. Specifically, I did:
brew install imagemagick
in terminal. There were no error messages. When I go to use imagemagick, e.g. using the command:
magick convert
I don't see the magick command available when I try to tab complete. I'm a bit uncertain how to debug this -- it seems like it should have installed fine?
As part of installing homebrew you need to set your PATH so your shell knows where the executable binaries are installed.
Depending on your homebrew version and macOS hardware and software, you may need:
export PATH=/opt/homebrew/bin:$PATH
or
export PATH=/usr/local/bin:$PATH
You can tell which of the two commands above you need with:
find {/opt/homebrew,/usr/local}/bin -name magick
Then run:
hash -r
and all homebrew commands like magick should work for your current session.
If you want the PATH set correctly for all future sessions you will need to add the export command from above to your login profile. That will depend on your shell, but is probably:
$HOME/.zprofile
or
$HOME/.profile
Note that you should read this answer to understand why you do NOT want to use magick convert.
Recently, I found a need to explore the Intel DAAL MKL for Data Science and was having difficulties finding the proper installations for a working environment in one location. After several days and trial and failures, I was able to reach a final installation process that I think would be beneficial to all the other Data Scientist enthusiast who are looking to get started with their Data Science adventures, utilizing Visual Studio Code or JupyterLab. Posted below are my recommended steps to get a working environment on Windows 10.
1. Download and install the latest version of Anaconda: https://www.anaconda.com/distribution/
2. Download and install the latest Graphviz installer from their Web site: https://graphviz.gitlab.io/download/ (in my case, version graphviz-2.38.msi was active)
a. Install graphviz msi for all users
b. Navigate to Environment Variables: https://t.ly/Gz359
c. Create a new environment path for the Graphviz (need two links to be added): (in my case it was: C:\Program Files (x86)\Graphviz2.38\bin\ and C:\Program Files (x86)\Graphviz2.38\bin\dot.exe
d. Close all command and environment windows
e. Open a new cmd window and test for the existence of Graphviz: c:\Users\MyDrive>dot -v
i. You should get a report of the version and other info (if it fails, check the environment path entry and possibly repair your Graphviz installation)
ii. Ctrl-C to close the report
iii. Close the cmd window
iv. Reboot your PC
3. Navigate to Anaconda Command Prompt as Administrator and remain in the (base) environment:
a. In Windows 10, Search for anaconda and select the anaconda command prompt:
i. Right-Click on it and select to run it as Administrator
b. Navigate to the root of the (base) environment:
i. cd\
c. Get a current list of existing environments:
i. conda env list
d. Remove any unwanted environments:
i. conda env remove -n OldenvironmentName
e. Create new desired environment for Intel Data Science (ids) with the most current Conda libraries, and supported Python version 3.x:
i. conda create -n ids python=3 numpy pandas seaborn matplotlib scikit-learn daal4py jupyterlab -y
f. Activate the new environment:
i. conda activate ids
g. Install Graphviz with pip:
i. pip install graphviz
h. Install python support for Graphviz:
i. conda install pydot python-graphviz -y
i. Check that dot is accessible via cmd prompt:
i. dot -v
j. Ctrl-C to close the report
k. Register the following for intel DataScience enhancements:
i. set USE_DAAL4PY_SKLEARN=YES
ii. python -c "import sklearn"
l. Reboot our PC
When you return to your Desktop, you will be ready to use your new environment for Data Science processes
I would like to define environmental variables for Spark on Scala for using in terminal and/or IntelliJ.
What is the right way to set it up?
My hidden home elements are the following:
$ ls .
./ .Trash/ .ivy2/
../ .android/ .matplotlib/
.CFUserTextEncoding .bash_history .oracle_jre_usage/
.DS_Store .bash_sessions/ .sbt/
I found the answer as it can be done by editing(in not exist, creating) file in home directory as the following:
COMMAND
MacBook-Pro:~ User$ nano .bash_profile
TYPE
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
export SCALA_HOME=/<SCALA-folder-path>
export HADOOP_HOME=/<HADOOP-folder-path>
export SPARK_HOME=/<Spark-folder-path>
PATH=$PATH:$JAVA_HOME/bin:$SCALA_HOME/bin:$SPARK_HOME/bin:$HADOOP_HOME/bin
export PATH
Is this absolutely genius method of changing conda environments going to break something later on?
So I didn't have the patience to read through and digest all the mumbo jumbo of changing conda environments. (i'm not even sure my usage of the term "environment" is correct).
I was trying to install py2exe (pip install py2exe) and I got an error and in the traceback I noticed that pip was using my old 2.7 anaconda python located in E:\Anaconda. My "new" or current 3.4 anaconda python is located in E:\Anaconda3...
So what i did was rename my E:\Anaconda folder to E:\poopAnaconda using windows explorer (right click, rename, etc.; using win7 64). Then in cmd prompt I typed
E:\Anaconda3>conda info -a
And then magically after renaming, conda info is now showing 3.4.1.final.0 as my python version and my environment is now successfully at E:\Anaconda3 !!! (you can see it about midway through the cmd output)
There was a slight pause after hitting enter (for conda info -a) and then the info displayed. The only difference I can see in the output is some warning about licenses pfffffff
Also both my anaconda folders are listed in PATH:
...E:\Anaconda;E:\Anaconda\Scripts;E:\Anaconda3;E:\Anaconda3\Scripts
In the FAQ, there are 8 different ways to activate and/or create an environment and none of those are as easy as this one.
So, is this a "bad" way of changing conda environments? I mean it works so far. But, why did it work?
Before my genious breakthrough:
E:\Anaconda3>conda info -a
Current conda install:
platform : win-64
conda version : 3.8.4
conda-build version : 1.8.2
python version : 2.7.8.final.0
requests version : 2.5.1
root environment : E:\Anaconda (writable)
default environment : E:\Anaconda
envs directories : E:\Anaconda\envs
package cache : E:\Anaconda\pkgs
channel URLs : http://repo.continuum.io/pkgs/free/win-64/
http://repo.continuum.io/pkgs/free/noarch/
http://repo.continuum.io/pkgs/pro/win-64/
http://repo.continuum.io/pkgs/pro/noarch/
config file : None
is foreign system : False
# conda environments:
#
root * E:\Anaconda
sys.version: 2.7.8 |Anaconda 2.1.0 (64-bit)| (default...
sys.prefix: E:\Anaconda
sys.executable: E:\Anaconda\python.exe
conda location: E:\Anaconda\lib\site-packages\conda
conda-build: E:\Anaconda\Scripts\conda-build.exe
conda-convert: E:\Anaconda\Scripts\conda-convert.exe
conda-develop: E:\Anaconda\Scripts\conda-develop.exe
conda-env: E:\Anaconda\Scripts\conda-env.exe
conda-index: E:\Anaconda\Scripts\conda-index.exe
conda-metapackage: E:\Anaconda\Scripts\conda-metapackage.exe
conda-pipbuild: E:\Anaconda\Scripts\conda-pipbuild.exe
conda-skeleton: E:\Anaconda\Scripts\conda-skeleton.exe
user site dirs:
CIO_TEST: <not set>
CONDA_DEFAULT_ENV: <not set>
CONDA_ENVS_PATH: <not set>
PATH: C:\Program Files (x86)\RSA SecurID Token Common;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsP
owerShell\v1.0\;e:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;e:\Program Files\AMD\ATI.ACE\Core-Static;E:\Python34_64bit;E:\Anaconda;E:\Anaconda\Scripts;E:\Anaconda3;E:\Anaconda3\Scripts
PYTHONHOME: <not set>
PYTHONPATH: <not set>
License directories:
C:\Users\Kardo Paska\.continuum
C:\Users\Kardo Paska\AppData\Roaming\Continuum
E:\Anaconda\licenses
License files (license*.txt):
Package/feature end dates:
E:\Anaconda3>
And after:
E:\Anaconda3>conda info -a
Current conda install:
platform : win-64
conda version : 3.7.0
conda-build version : 1.8.2
python version : 3.4.1.final.0
requests version : 2.4.1
root environment : E:\Anaconda3 (writable)
default environment : E:\Anaconda3
envs directories : E:\Anaconda3\envs
package cache : E:\Anaconda3\pkgs
channel URLs : http://repo.continuum.io/pkgs/free/win-64/
http://repo.continuum.io/pkgs/pro/win-64/
config file : None
is foreign system : False
# conda environments:
#
root * E:\Anaconda3
sys.version: 3.4.1 |Anaconda 2.1.0 (64-bit)| (default...
sys.prefix: E:\Anaconda3
sys.executable: E:\Anaconda3\python.exe
conda location: E:\Anaconda3\lib\site-packages\conda
conda-build: E:\Anaconda3\Scripts\conda-build.exe
conda-convert: E:\Anaconda3\Scripts\conda-convert.exe
conda-develop: E:\Anaconda3\Scripts\conda-develop.exe
conda-index: E:\Anaconda3\Scripts\conda-index.exe
conda-metapackage: E:\Anaconda3\Scripts\conda-metapackage.exe
conda-pipbuild: E:\Anaconda3\Scripts\conda-pipbuild.exe
conda-skeleton: E:\Anaconda3\Scripts\conda-skeleton.exe
user site dirs:
CIO_TEST: <not set>
CONDA_DEFAULT_ENV: <not set>
CONDA_ENVS_PATH: <not set>
PATH: C:\Program Files (x86)\RSA SecurID Token Common;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsP
owerShell\v1.0\;e:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;e:\Program Files\AMD\ATI.ACE\Core-Static;E:\Python34_64bit;E:\Anaconda;E:\Anaconda\Scripts;E:\Anaconda3;E:\Anaconda3\Scripts
PYTHONHOME: <not set>
PYTHONPATH: <not set>
WARNING: could not import _license.show_info
# try:
# $ conda install -n root _license
E:\Anaconda3>
NICE!!
E:\Anaconda3>pip install py2exe
Downloading/unpacking py2exe
Installing collected packages: py2exe
Successfully installed py2exe
Cleaning up...
E:\Anaconda3>
This will work, but I wouldn't recommend it.
In the context of conda environments, "activating" an environment just means putting that environment to the front of your PATH, so that programs from that environment get picked up first when you type them. Putting multiple things on your PATH and moving them works too, because nonexistant paths are just skipped when the PATH is searched.
First off, you shouldn't install Anaconda twice. Rather, use conda to create additional environments.
You aren't making use of conda: One of the strengths of Anaconda is the conda package manager, which manages the environments. It would be better to pick one of your Anaconda installations as the base one and create the other one as a conda environment (e.g., if you pick Anaconda3 as your base create a Python 2 environment with conda create -n py2 python=2 anaconda). Then activate py2 and deactivate.
If you use conda, you can get confused: Each installation of Anaconda has a different conda installed. This means to manage each one, you'll need to use the conda that is in that one. Using the wrong conda could lead to issues (it's not really supported). With one Anaconda and environments, you can use conda install -n envname and it will do the right thing, because there will only be one conda.
But even ignoring that, regarding your genius idea, some issues would be:
PATH "leak through": If you have both Anaconda and Anaconda3 on your PATH and something is installed in the second but not the first, it will pick up the Anaconda3 one (because the way PATH works is it searches all the directories for the command until it finds it). On OS X and Linux source activate will remove the root environment from the PATH to prevent this from happening. This doesn't happen yet on Windows but we want to change it.
Inconvenience: Is moving a directory around really easier than typing activate envname? Also consider that if you create a new environment, you will have to add it to the PATH for this trick to work. If you make good use of conda, you'll be making many environments.
You might break the environment: This is not entirely true for Windows, at least for most packages. It is very true on OS X and Linux. Moving an environment can break it, because there are hard-coded paths in places. So things in your poopAnaconda directory might not work until you name it bake to Anaconda.
I just downloaded ImageMagick but am not sure if it's working. I typed in 'which convert' into my terminal and nothing happened. I also tried typing in 'convert logo: logo.gif' then 'identify logo.gif' and lastly 'display logo.gif' and nothing seemed to happen (these three commands were specified on Windows).
Then I tried following this video: http://www.youtube.com/watch?v=gEWAVlNCKhg
However, it still didn't work and on the last step of the video. I got the following error: ERROR: While executing gem ... (OptionParser::InvalidOption) invalid option: ----with-opt-include=C:/ImageMagick/SourceCode
Can anyone advise on how to correctly install imagemagick on windows or what these errors mean?
That video has a bunch of unnecessary stuff if all you want to do is get ImageMagick working as a standalone product on Windows. All you need to do is:
Download latest Windows binary from imagemagick.org. Right now, that file is located here.
Run the installer (leave all default values the way they are)
Open a command prompt (Start --> Run --> cmd.exe)
Navigate to the ImageMagick folder in the command prompt window. For the default install path, this is done as follows :
Change to the root directory of the C: drive (type cd\ followed by the enter key)
Change to the ImageMagick folder (type cd "Program Files\ImageMagick-6.8.6-Q16" followed by the enter key)
Test that it's working with the convert command: convert images\logo.jpg logo.gif
Look at the directory listing and check the for a logo.gif file with the current time/datestamp (dir logo.gif, followed by enter key).
Note: when you run the convert command, there will not be any output to the command prompt unless you turn on the verbose flag e.g. (convert -verbose images\logo.jpg logo.gif)
I noticed that in my installation that there was not a 'display.exe', but there was an 'imdisplay.exe". I tried using imdisplay in a folder that had images, and it did not how a window. I double clicked imdisplay.exe in the installation folder, and windows came up, including all of the ones I tried to open on the command line. When I closed all of those windows and tried the command line again, it worked.
I am not sure where you are getting 'which convert' (I did not watch the video). I can see all of the exe files that are available in the installation folder. convert.exe is one of them, so in a regular cmd window (I do not know anything about Powershell GitShell), you can just type:
convert logo.png logo.jpg
or something like that.