Many classical image processing tasks can be realized as evaluations of a boolean function over subsets of an image. For instance, the simplicity test used in 3D thinning requires examining the 26 neighbors of each voxel and computing a single boolean function of these inputs. In this article, we show how Binary Decision Diagrams can be used to produce automatically very efficient and compact code for such functions. The total number of operations performed by a generated function is at most one test and one branching for each input value (e.g., in the case of 3D thinning, 26 tests and branchings). At each stage, the function is guaranteed to examine only the pertinent input data, i.e., the values which affect the result. As an example, we consider the 2D and 3D simplicity tests in digital topology, and thinning processes. We produce functions much faster than our previously optimized implementations [18, 4], and than any other implementation we know of. In the case of 3D simplicity test, on average, at each voxel only 8.7 neighboring voxel values are examined. Résumé : Un certain nombre de techniques de traitement d'image reposent sur l'e ´valuation d'une fonction booléenne sur des parties de l'image. Par exemple, la caractérisation des points simples utilisée pour l'amincissement 3D requiert d'examiner les 26 voisins de chaque voxel, et de calculer une fonction booléenne de ces valeurs. Dans cet article, nous montrons comment utiliser les Diagrammes de Décision Binaires pour produire automatiquement du code très efficace et compact implémentant de telles fonctions. Le nombre total d'opérations effectuées par la fonction produite est au plus d'un test et un branchement par valeur d'entrée (c'est-a `-dire, dans le cas de l'amincissement 3D, 26 test et branchements). A ` chaque e ´tape, la fonction n'examine que les valeurs qui ont une influence sur le résultat. Comme application, nous considérons la caractérisation des points simples en topologie discrète 2D et 3D, et plusieurs techniques d'amincissement 3D. Nous produisons des fonc-tions beaucoup plus efficaces que nos implémentations optimisées existantes [18, 4], et que toutes les autres implémentations que nous connaissons. Pour caractériser les points simples en 3D, il suffit en moyenne pour chaque voxel d'examiner 8.7 voisins.