{"id":5258,"library":"imutils","title":"imutils: Image Processing Utility Functions","description":"imutils is a Python package providing a series of convenience functions to simplify basic image processing operations such as translation, rotation, resizing, skeletonization, displaying Matplotlib images, sorting contours, and detecting edges. It acts as a companion library to OpenCV, streamlining common tasks and reducing boilerplate code. The current version is 0.5.4, released on January 15, 2021. The library has a slow release cadence, with no new versions in over three years, suggesting it is in maintenance mode rather than active development.","status":"maintenance","version":"0.5.4","language":"python","source_language":"en","source_url":"https://github.com/jrosebr1/imutils","tags":["computer vision","image processing","opencv","utilities","helper functions"],"install":[{"cmd":"pip install imutils","lang":"bash","label":"Install imutils via pip"}],"dependencies":[{"reason":"Imutils heavily relies on OpenCV for all its image processing functionalities. This (or `opencv-contrib-python`) must be installed separately.","package":"opencv-python","optional":false},{"reason":"Used for numerical operations on image arrays, a core dependency for image manipulation in Python.","package":"numpy","optional":false},{"reason":"Often used for displaying images, especially in development and debugging contexts.","package":"matplotlib","optional":true}],"imports":[{"wrong":"import imutils","symbol":"imutils","correct":"import imutils"}],"quickstart":{"code":"import cv2\nimport imutils\nimport numpy as np\n\n# Simulate reading an image (replace with cv2.imread('path/to/image.jpg'))\n# For demonstration, create a dummy black image (BGR format)\nimage = np.zeros((300, 500, 3), dtype=\"uint8\")\ncv2.putText(image, \"Original Image\", (100, 150), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 2)\n\n# Use imutils.resize to resize the image while maintaining aspect ratio\nresized_image = imutils.resize(image, width=150)\n\n# Display original and resized images\ncv2.imshow(\"Original\", image)\ncv2.imshow(\"Resized (width=150)\", resized_image)\n\ncv2.waitKey(0)\ncv2.destroyAllWindows()","lang":"python","description":"This quickstart demonstrates how to use `imutils.resize` to scale an image while preserving its aspect ratio. It first creates a dummy image (you'd typically load one with `cv2.imread`) and then resizes it to a specified width. Both the original and resized images are displayed using OpenCV's `imshow` function."},"warnings":[{"fix":"Consider alternatives for specific functionalities or manually install dependencies if encountering build errors. Users have reported issues on GitHub related to `setuptools` not being available in the build environment.","message":"As of late 2024, `imutils` has faced installation issues (e.g., `error: metadata-generation-failed`) for some users due to its reliance on `distutils` and `setup.py`, which are deprecated in newer Python/pip environments. The project also appears to be unmaintained, with no recent updates or fixes to these issues.","severity":"breaking","affected_versions":"0.5.4 and potentially older versions with newer pip/Python environments"},{"fix":"Ensure `opencv-python` is installed: `pip install opencv-python`.","message":"Imutils is a wrapper around OpenCV; therefore, `opencv-python` (or `opencv-contrib-python`) is a crucial, unlisted peer dependency. Trying to use `imutils` without `opencv-python` installed will result in `ImportError: No module named 'cv2'`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure `numpy` is installed: `pip install numpy`.","message":"Similar to OpenCV, `imutils` operations often rely on NumPy arrays. Forgetting to install `numpy` can lead to `ModuleNotFoundError: No module named 'numpy'` or other runtime errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Convert the image from BGR to RGB before displaying with Matplotlib: `image_rgb = cv2.cvtColor(image_bgr, cv2.COLOR_BGR2RGB)`.","message":"When displaying images using Matplotlib, remember that OpenCV (and by extension, `imutils` results) stores images in BGR format, while Matplotlib expects RGB. Displaying a BGR image directly with Matplotlib will result in incorrect color representation (e.g., blue appears red and vice-versa).","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'0.5.4':56 '15':60 '2021':61 'act':38 'activ':85 'basic':19 'boilerpl':50 'cadenc':68 'code':51 'common':46 'companion':41 'comput':87 'contour':33 'conveni':15 'current':53 'detect':35 'develop':86 'display':29 'edg':36 'function':5,16,94 'helper':93 'imag':2,20,31,89 'imutil':1,6 'januari':59 'librari':42,63 'mainten':81 'matplotlib':30 'mode':82 'new':71 'opencv':44,91 'oper':22 'packag':10 'process':3,21,90 'provid':11 'python':9 'rather':83 'reduc':49 'releas':57,67 'resiz':27 'rotat':26 'seri':13 'simplifi':18 'skeleton':28 'slow':66 'sort':32 'streamlin':45 'suggest':77 'task':47 'three':75 'translat':25 'util':4,92 'version':54,72 'vision':88 'year':76","created_at":"2026-04-14T01:26:02.597681+00:00","updated_at":"2026-04-16T15:43:41.691482+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmp11a9k57e/venv/lib/python3.12/site-packages/imutils/__init__.py\", line 8, in <module>\n    from .convenience import translate\n  File \"/tmp/tmp11a9k57e/venv/lib/python3.12/site-packages/imutils/convenience.py\", li"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.5.4","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/jrosebr1/imutils","docs":null,"changelog":null,"pypi":"https://pypi.org/project/imutils/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-08-30","next_check":"2026-07-10","install_tag":null}}